How to re-render a template in an AngularJS directive?

后端 未结 6 1182
一个人的身影
一个人的身影 2020-12-08 03:22

I\'ve create a directive that generates Twitter buttons. Since the scope variables on those buttons may change, I need to rebuild the button when it happens. Currently, I\'m

6条回答
  •  天涯浪人
    2020-12-08 03:38

    Another way to achieve this is to make use of ng-if.

    For example:

    The directive will not be created until your renderdirective is not true. This will also work the other way round if you wish to remove the directive and let it be recreated using the new attribute values.

提交回复
热议问题