You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Nested Directives with postLink functions using templateUrl instead of inline template.
Expectations
Post link functions of directives should execute in the order reverse to the DOM traversal i.e. post Link function of an outer/parent directive should execute after the postLink function of inner/child directive. Also note that require: '^outer' states the parent.
Symptom/defect
Sequence
---- Expected START --- controller - outer -----
---- Expected END --- postlink - outer ----- 💔 (should be at the end )
-- controller - inner1
---- controller - inner2
---- postlink - inner2
(inner2 pushed)
---- controller - inner2
---- postlink - inner2
(inner2 pushed)
---- postlink - inner1
(inner1 pushed)
High level conclusion
When using templateUrl postLink function will NOT execute as documented.
Is this a defect or we need to update the documentation ?
The issue occurs when you use templateUrl rather transclude.
This plunker-with templateUrl shows the issues. You have hit refresh or Stop/Run a few times before you see the step ---- Expected END --- postink outer-- seen out of sequence. This should be always be seen at the end as it should be executed at then end being the post link function of the outer directive.
[Plunker with inlined template0(http://embed.plnkr.co/V79NDs4xQSGAsFlSrwPX/preview) which does not seem to reproduce the problem no matter how many times we refresh the page /soft reload (i.e. hit enter in the browser location bar).
The text was updated successfully, but these errors were encountered:
Scenario
Nested Directives with postLink functions using templateUrl instead of inline template.
Expectations
Post link functions of directives should execute in the order reverse to the DOM traversal i.e. post Link function of an outer/parent directive should execute after the postLink function of inner/child directive. Also note that require:
'^outer'
states the parent.Symptom/defect
High level conclusion
When using templateUrl postLink function will NOT execute as documented.
Is this a defect or we need to update the documentation ?
This is in relation to stackoverflow - post-link-execution-order
The issue occurs when you use templateUrl rather transclude.
This plunker-with templateUrl shows the issues. You have hit refresh or Stop/Run a few times before you see the step
---- Expected END --- postink outer--
seen out of sequence. This should be always be seen at the end as it should be executed at then end being the post link function of the outer directive.[Plunker with inlined template0(http://embed.plnkr.co/V79NDs4xQSGAsFlSrwPX/preview) which does not seem to reproduce the problem no matter how many times we refresh the page /soft reload (i.e. hit enter in the browser location bar).
The text was updated successfully, but these errors were encountered: