Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"terminal" property of preloadImage breaks other directives #1

Open
mcwebb opened this issue Feb 21, 2015 · 3 comments
Open

"terminal" property of preloadImage breaks other directives #1

mcwebb opened this issue Feb 21, 2015 · 3 comments

Comments

@mcwebb
Copy link

mcwebb commented Feb 21, 2015

Hi there,
I really like the directive thanks very much for your work.
I just thought I should report that the terminal property of the preloadImage directive can break other directives really badly. Both "ui-sref" from the ui.router module and "on-touch" from Ionic are broken when "preload-image" is applied to the same element. I'm sure there's a reason you've included this property, however I've removed it in this fork and have had no adverse effects so far.

@RevillWeb
Copy link
Owner

Hi mcwebb, thank you for contacting me. The reason for using terminal is to overwrite the ng-src directive so that the preload image directive can take control of the element src attribute. If you remove terminal you probably wont see any diverse affects but it wont be pre-loading your images. Have you tried a really, really big image? You will probably get the waterfall effect. I will take a look at your fork and get back to you, thanks again.

@mcwebb
Copy link
Author

mcwebb commented Feb 24, 2015

Ah, okay that makes sense.
This is potentially not an issue that is worth fixing since there are many simple workarounds e.g. applying the 3rd-party directives to a container element rather than the <img /> itself.
However as far as I understand terminal: true could be avoided by using a different attribute to define the image url i.e. rather than ng-src="file.jpg" use real-image="file.jpg".
I'll test this in my fork but since this is an edge-case and would introduce major breaking changes feel free to disregard.

Cheers

@ghost
Copy link

ghost commented Aug 25, 2015

Hello,
Thank you very much for you work.
Did notice that ng-style does not work with directive either, and mcwebb's solution did fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants