This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Description
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.
Current behavior:
Refer plunker
- 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.
AngularJS version: 1.6.4
Yes it is an issue.
Browser: [all | Chrome 63.0.3239.132 | Firefox |
OS: Windows 10