AngularJS 标准指令优先级列表 [英] AngularJS standard directive priority list

查看:23
本文介绍了AngularJS 标准指令优先级列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找标准 angularjs 指令及其优先级(尤其是非零指令)的列表.每当您想创建一个特殊指令时查看它会很有帮助,例如带有 terminal: true 的指令,以查看它最适合的位置,同时也可以更好地理解角度设计者的意思以便使用他们的指令.

我知道每个指令在其文档页面中都指定了其优先级,但这无助于了解编译/链接顺序的全貌,如下所示:

<前>指令 - Prio-----------------ng-重复 - 1000ng-if - 600ng-包括 - 400...

谢谢.

解决方案

按优先级排序的标准角度指令列表.希望这会有所帮助.

指令优先级--------------- -----------ng-switch 1200ng-不可绑定 1000ng-重复 1000ng-if 600ng-控制器 500ng-init 450ng-包括 400ng-检查 100ng-禁用 100ng-打开 100ng-只读 100ng-选择 100ng-href 99ng-src 99ng-srcset 99ng-模型 1ng-app 0ng绑定0ng-bind-html 0ng-绑定-模板 0模糊 0ng-change 0ng-class 0ng-class-even 0ng-class-odd 0ng-单击 0ng-斗篷 0ng-复制 0ng-csp 0ng-cut 0ng-dbl-单击 0ng-焦点 0ng-form 0ng-隐藏 0ng-keydown 0ng-按键 0ng-keyup 0ng-list 0ng-model-options 0ng-mousedown 0ng-鼠标输入 0ng-mouseleave 0ng-mousemove 0ng-鼠标悬停 0ng-mouseup 0ng-选项 0ng-paste 0ng-复数 0ng-show 0ng-style 0ng-提交 0ng-transclude 0ng 值 0

参考资料

I'm looking for a list of standard angularjs directives with their priorities (especially the nonzero ones). It would be helpful to look at it whenever you want to create a special directive, for example one with terminal: true, to see where it would fit best, but also to better understand how the angular designers meant for their directives to be used.

I know each directive has its priority specified in its documentation page, but that does not help to have a whole picture of the compile/link order, as a list like the one below would:

Directive  - Prio
-----------------
ng-repeat  - 1000
ng-if      -  600
ng-include -  400
...

Thank you.

解决方案

List of standard angular directives sorted by their priorities. Hope this will be useful.

Directive           Priority    
---------------     -----------
ng-switch           1200    
ng-non-bindable     1000    
ng-repeat           1000    
ng-if               600 
ng-controller       500 
ng-init             450 
ng-include          400 
ng-checked          100 
ng-disabled         100 
ng-open             100 
ng-readonly         100 
ng-selected         100 
ng-href             99  
ng-src              99  
ng-srcset           99  
ng-model            1   
ng-app              0   
ng-bind             0   
ng-bind-html        0   
ng-bind-template    0
ng-blur             0
ng-change           0
ng-class            0
ng-class-even       0
ng-class-odd        0
ng-click            0
ng-cloak            0
ng-copy             0
ng-csp              0
ng-cut              0
ng-dbl-click        0
ng-focus            0
ng-form             0
ng-hide             0
ng-keydown          0
ng-keypress         0
ng-keyup            0
ng-list             0
ng-model-options    0
ng-mousedown        0
ng-mouseenter       0
ng-mouseleave       0
ng-mousemove        0
ng-mouseover        0
ng-mouseup          0
ng-options          0
ng-paste            0
ng-pluralize        0
ng-show             0
ng-style            0
ng-submit           0
ng-transclude       0
ng-value            0

References

这篇关于AngularJS 标准指令优先级列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆