Angular directive removes original attribute from element

Viewed 182

When adding a directive on some element (e.g. img), and if that directive has some attribute from it as @Input() (e.g. src), original attribute will be change with ng-reflect-* (e.g. ng-reflect-src) and image will never be shown, since there is no src attribute.

It will only happen if it's src has to be evaluated, does not happen on fixed urls!

Is this expected behavior or is it bug? Is it possible to make it work? (At the moment I am workarounding it by using src and source and having as input for the directive only source.)

Example can be seen on following plnkr (two images should be shown but there is only one): https://plnkr.co/edit/5AjZPeyEfd6IOqxQp3kq?p=preview

1 Answers
Related