Im trying to hide images loading until they are completed and cant figure out how to do that easily in Angular. Can onload call a function in the scope? Or is there a better way to do this? ng-init doesnt work
Asked
Active
Viewed 399 times
0
-
Load them via `$http` and as the AJAX call completes, use them? – Johannes Jander Feb 15 '16 at 21:05
-
Possible duplicate of [execute function on page load?](http://stackoverflow.com/questions/15458609/execute-function-on-page-load) – Alvaro Silvino Feb 15 '16 at 21:06
-
thats a good idea, Ill try it thanks – user718229 Feb 15 '16 at 21:06
-
page load events won't help you in angular.... you need to use `onload` event of each image element. My bet is there is already a simple directive around for this...but is also easy to create – charlietfl Feb 15 '16 at 22:16
-
Does the `ng-src` directive solve your problem? https://docs.angularjs.org/api/ng/directive/ngSrc – georgeawg Feb 15 '16 at 23:14
-
no unfortunately, i'm using ng-src but theyre stll visibly downloading. – user718229 Feb 16 '16 at 02:33