pbojinov
8/7/2015 - 5:08 PM

Angular Directive Priority - Quick Reference

Angular Directive Priority - Quick Reference

##Angular Directive Priority - Quick Reference

When there are multiple directives defined on a single DOM element, sometimes it is necessary to specify the order in which the directives are applied. The priority is used to sort the directives before their compile functions get called. Priority is defined as a number. Directives with greater numerical priority are compiled first. Pre-link functions are also run in priority order, but post-link functions are run in reverse order. The order of directives with the same priority is undefined. The default priority is 0.

For a brief description of each directive, click here.

DirectivePriorityTerminalCreates new scopeCan be used as multiElement
ngSwitch1200X
ngNonBindable1000X
ngRepeat1000XXX
ngIf600XXX
ngController500X
ngInit450
ngInclude400XX
ngView400X
ngChecked100
ngDisabled100
ngOpen100
ngReadonly100
ngSelected100
ngHref99
ngSrc99
ngSrcset99
ngModel1
a0
form0
input0
ngApp0
ngBind0
ngBindHtml0
ngBindTemplate0
ngBlur0
ngChange0
ngClass0
ngClassEven0
ngClassOdd0
ngClick0
ngCloak0
ngCopy0
ngCsp0
ngCut0
ngDblclick0
ngFocus0
ngForm0
ngHide0X
ngJq0
ngKeydown0
ngKeypress0
ngKeyup0
ngList0
ngMessages0X
ngModelOptions0
ngMousedown0
ngMouseenter0
ngMouseleave0
ngMousemove0
ngMouseover0
ngMouseup0
ngOptions0X
ngPaste0
ngPluralize0
ngShow0X
ngStyle0
ngSubmit0
ngTransclude0
ngValue0
script0X
select0
textarea0