gpt4 book ai didi

javascript - 在 AngularJS 中创建子范围的所有指令是什么?

转载 作者:行者123 更新时间:2023-11-30 05:31:34 24 4
gpt4 key购买 nike

我没有意识到 ng-if 创建了一个子作用域,这引起了相当大的困惑。 ng-if 范围创建的原因/好处是什么?创建子作用域的其他内置指令是什么?

The scope created within ngIf inherits from its parent scope using prototypal inheritance.

最佳答案

所以 these是我用来查找创建作用域的所有指令的关键字,感谢 @sp00m 的提示。

假设 Angular 的文档在描述指令的方式上是一致的,下面是完整的结果列表,按照执行的优先级排序:

  1. 1200, ngSwitch
  2. 1000, ngRepeat
  3. 600, ngIf
  4. 500, ngController
  5. 400, ngInclude
  6. 400, ngView
  7. 0, ngMessage

关于javascript - 在 AngularJS 中创建子范围的所有指令是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26649270/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com