Angular Directive attrs.$observe

后端 未结 2 568
盖世英雄少女心
盖世英雄少女心 2021-01-17 11:37

I found this Angular Directive online to add a twitter share button. It all seems staright forward but I can\'t work out what the attrs.$observe is actually doi

2条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-17 11:53

    
    

    sr

    .directive('sr',function(){ return { link: function(element, $scope, attrs){ attrs.$observe('sr', function() { console.log('change observe') }); } }; })

提交回复
热议问题