AngularJS ng-if directive briefly renders even when condition is false before removing element

后端 未结 2 1700
野性不改
野性不改 2021-01-02 17:05

In the below template, I would expect the script tag to never render, and the alert script to never execute. However it does.

2条回答
  •  囚心锁ツ
    2021-01-02 17:44

    I think that false expression is not well converted to angular false. I can prove this by setting:

    Which doesn't render text in current div. Anyway, it executes alert, i suppose it is executed before angular runs, that's why.

提交回复
热议问题