Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

fix($compile): fix (reverse) directive postLink fn execution order #4266

Closed
wants to merge 2 commits into from

Commits on Oct 3, 2013

  1. 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 angular#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 angular#3558
    IgorMinar committed Oct 3, 2013
    Configuration menu
    Copy the full SHA
    7fb4344 View commit details
    Browse the repository at this point in the history
  2. fix($compile): don't terminate compilation for regular transclusion d…

    …irectives
    
    Previously we would stop the compilation for both regular and element
    transclusion directives which was wrong. Only element transclusion directives
    should be terminal.
    IgorMinar committed Oct 3, 2013
    Configuration menu
    Copy the full SHA
    eb823b5 View commit details
    Browse the repository at this point in the history