javascript - Angular filter on select menu disables buttons in filtered element directives -


i have angular app running hosted service. issue i'm having relatively small 1 frustrating nonetheless.

i have set of custom directives loaded page ng-repeat , filter based on value of select element using ng-model. works fine.

in element directives have 'close' button removes element page. issue arises when change value of select menu show closed element. once element reappears, buttons in element won't fire callbacks. thought had fact link function happens once, functionality returns after few more toggles select menu.

if has insight on this, appreciate it. filter when removed, or brought back? why cause event handles not function?

here's example.

    angular.module("app",[])     .directive("test",function(){       return {         restrict: 'e',         scope:{           name:'@'         },         templateurl:"test.html",         link: function(scope,element,attrs){           scope.hide=function(){              element.remove();           };         }       };     })     .controller("appcontroller",['$scope',function($scope){    $scope.examples=[         {           name:'first'         },         {           name:'second'         },         {           name:'third'         }         ];     }]); 

to see behavior, click hide on of elements, try selecting element , see hide button won't work.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -