Calling order of link function in nested and repeated angularjs directives

后端 未结 2 1328
时光取名叫无心
时光取名叫无心 2020-12-24 09:25

I\'m fairly new to Javascript programming and I have only touched upon AngularJS. In order to evaluate it I decided to write a simple note application. The model is really s

2条回答
  •  情歌与酒
    2020-12-24 10:23

    On a single element the order of the linking functions is determined by the order of the Compile Functions which in turn is ordered according to the priority property of the directive definition object.

    Source : http://docs.angularjs.org/guide/directive

    On multiple elements with transclusion : the inner directives are evaluated before outer directives. Reason: Nature of transclusion.

    On multiple elements with siblings : Executed in order top to bottom. Reason: Parsing logic of $compile.

提交回复
热议问题