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

specifying loading-src always loads fallback image ! #21

Closed
uzumakinaruto123 opened this issue Apr 2, 2016 · 8 comments
Closed

specifying loading-src always loads fallback image ! #21

uzumakinaruto123 opened this issue Apr 2, 2016 · 8 comments

Comments

@uzumakinaruto123
Copy link

If i do this :-

<img ng-src="{{data.resimage}}" fallback-src="img/default{{ imageNo }}.jpg" alt="" />

Works great

As soon as i add loading-src like dis :-

<img ng-src="{{data.resimage}}" loading-src fallback-src="img/default{{ imageNo }}.jpg" alt="" />

IT WILL ALWAYS LOAD FALLBACK

I even tried this :-

<img ng-src="{{data.resimage}}" loading-src="img/default{{ imageNo }}.jpg" fallback-src="img/default{{ imageNo }}.jpg" alt="" />

Help is appreciated ! Thanks.

@dcohenb
Copy link
Owner

dcohenb commented Apr 2, 2016

i dont understand. if you provide the same source for fallback and loading what are you expecting?

@uzumakinaruto123
Copy link
Author

No.i dont want to provide same src. i just tried that second option ! so in the first one i added only loading-src .

I was expecting plugins default loading-src here. but got nothing different.

@uzumakinaruto123
Copy link
Author

@dcohenb

UPDATE :-1

I removed fallback-src and used only loading-src , and it worked.

Issue

It works only within ng-repeat perfectly !

Problem occurs when using collection-repeat .
If collection repeat is used the img src is not updated and still shows fallback/loading src

@stefensuhat
Copy link

+1

I'm experiencing this. When I try load image from ajax request, the image always shown loading/fallback src. It never load the real image. But if I put the image directly (no ajax request), the real image is load properly.

@dcohenb
Copy link
Owner

dcohenb commented Apr 5, 2016

What's collection-repeat?
Can you provide a complete code sample of what is it that your trying to do?
"load image from ajax" just doesn't make much sense here

@uzumakinaruto123
Copy link
Author

@dcohenb ohh really sorry for that ! i forgot that its not a ionic framework.

well just to explain in short,

ionic framework in a hybrid app development framework in which apps are based on javascript.
ionic framework uses angular js wrapper to do so.

ionic has an alternative to ng-repeat i.e collection-repeat

collection-repeats are used to improve the performance of list in angular or specifically ionic.

sorry for not mentioning that before.

@dcohenb
Copy link
Owner

dcohenb commented Apr 6, 2016

@uzumakinaruto123 Thanks for the explanation, can you give me a code sample or a JSFiddle replicating the bug you're talking about? i really want to help you but i need to see the problem as i can't understand it from the description.

@uzumakinaruto123
Copy link
Author

i tried my best to reproduce the issue ! i wonder if this is ionic issue ..

Here is the codepen

http://codepen.io/uzumakinaruto1/pen/wGPNbe

on this codepen if you check second list its collection-repeat which is not loading ng-src image
even if image is present.

ng-repeat loads it correctly. you can replace that 'collection' with 'ng' and you will see that it also works on second list.

P.S :- loading-src is online image just for demo purpose

Thanks !

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

3 participants