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.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
ng-attr- used for custom directive. If expression is undefined, still fires directive link function, even though the directive is not added in the DOM. #16441
I'm submitting a bug, regarding ng-attr- directive, used to conditionally add directive (as an attribute), if expression is undefined, still fires link function of the directive, even though directive is not added in the DOM.
Added conditional directive (as an attribute), using ng-attr-test-directive (as mentioned in plunker).
Even though ng-attr- expression is undefined and directive is not added in the DOM, the link function of the directive is fired (check console while executing plunker)
Expected / new behavior:
When ng-attr- expression is undefined,
It shouldn't add directive to the DOM.
It should not call link function of the directive as well.
Minimal reproduction of the problem with instructions:
Please refer plunker
Same repo steps as mentioned in Current behavior.
I'm submitting a bug, regarding
ng-attr-directive, used to conditionally add directive (as an attribute), if expression is undefined, still fireslinkfunction of the directive, even though directive is not added in the DOM.Current behavior:
Refer plunker
ng-attr-test-directive(as mentioned in plunker).ng-attr-expression isundefinedand directive is not added in the DOM, thelinkfunction of the directive is fired (check console while executing plunker)Expected / new behavior:
When
ng-attr-expression is undefined,Minimal reproduction of the problem with instructions:
Please refer plunker
Same repo steps as mentioned in Current behavior.
AngularJS version: 1.6.4
Yes it is an issue.
Browser: [all | Chrome 63.0.3239.132 | Firefox |
OS: Windows 10