1

If I use AngularJS custom directive, which executes a function, and then use a regular directive like ng-repeat, then which one gets executed first?

for example - in a Select element, if I have use custom multi-select directive and in the same I use an ng-repeat, then which directive gets executed first. Is it in the sequence it is defined?

<select multi-select ng-repeat="x in Xes" multiple></select>

1 Answers1

1

The priority is property that defines which directive will be compiled or linked first. To avoid the duplication of explanations, read this post here.

I think that's what you want to know.

Community
  • 1
  • 1
arman1991
  • 1,166
  • 1
  • 18
  • 28
  • 1
    to add to @arman1991. If two directives have the same priority (or if you don't specify one then it defaults to priority 0), then you cannot rely on the order they are placed in the DOM as the sequence will be determined by the browser. If you care about the sequence then you should specify the priority. – ken4z Nov 18 '14 at 22:43