diff options
| author | Igor Minar | 2013-10-01 07:55:47 -0700 | 
|---|---|---|
| committer | Igor Minar | 2013-10-03 22:23:37 -0700 | 
| commit | 31f190d4d53921d32253ba80d9ebe57d6c1de82b (patch) | |
| tree | 147f87340b3ca3cd41d31537f876642c70bd133f /src/ng/directive/input.js | |
| parent | fe2145016cb057c92f9f01b32c58b4d7259eb6ee (diff) | |
| download | angular.js-31f190d4d53921d32253ba80d9ebe57d6c1de82b.tar.bz2 | |
fix($compile): fix (reverse) directive postLink fn execution order
previously the compile/link fns executed in this order controlled via priority:
- CompilePriorityHigh, CompilePriorityMedium, CompilePriorityLow
- PreLinkPriorityHigh, PreLinkPriorityMedium, PreLinkPriorityLow
- link children
- PostLinkPriorityHigh, PostLinkPriorityMedium, PostLinkPriorityLow
This was changed to:
- CompilePriorityHigh, CompilePriorityMedium, CompilePriorityLow
- PreLinkPriorityHigh, PreLinkPriorityMedium, PreLinkPriorityLow
- link children
- PostLinkPriorityLow, PostLinkPriorityMedium , PostLinkPriorityHigh
Using this order the child transclusion directive that gets replaced
onto the current element get executed correctly (see issue #3558),
and more generally, the order of execution of post linking function
makes more sense. The incorrect order was an oversight that has
gone unnoticed for many suns and moons.
(FYI: postLink functions are the default linking functions)
BREAKING CHANGE: the order of postLink fn is now mirror opposite of
the order in which corresponding preLinking and compile functions
execute.
Very few directives in practice rely on order of postLinking function
(unlike on the order of compile functions), so in the rare case
of this change affecting an existing directive, it might be necessary
to convert it to a preLinking function or give it negative priority
(look at the diff of this commit to see how an internal attribute
interpolation directive was adjusted).
Closes #3558
Diffstat (limited to 'src/ng/directive/input.js')
| -rw-r--r-- | src/ng/directive/input.js | 2 | 
1 files changed, 1 insertions, 1 deletions
| diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js index fa953419..ee613a6e 100644 --- a/src/ng/directive/input.js +++ b/src/ng/directive/input.js @@ -958,7 +958,7 @@ var VALID_CLASS = 'ng-valid',      </file>   * </example>   * - *  + *   */  var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$parse',      function($scope, $exceptionHandler, $attr, $element, $parse) { | 
