Conditional ng-include in angularjs

前端 未结 5 2272
囚心锁ツ
囚心锁ツ 2020-12-04 10:48

How can I do the ng-include conditionally in angularJS?

For example I only want to include something if, the variable x is set to true.

5条回答
  •  执念已碎
    2020-12-04 11:43

    A little bit more readable version of one of the answers. Plus setting ng-include to null removes the element - just like ng-if.

提交回复
热议问题