Loading images asynchronously in directives.

733 views
Skip to first unread message

tas pas

unread,
Apr 13, 2013, 4:37:40 PM4/13/13
to ang...@googlegroups.com
Hello all, 

I've created a directive which includes an ng-src that expects an image url that comes asynchronously to the scope of the directive.
When the images gets loaded an I have the the url the directive does not show the image.

the directive template has something like that:

<img src="{{photoToBeLoaded}}">

and the $scope.photoToBeLoaded comes after a $http.post.

Anyone know why?

Pawel Kozlowski

unread,
Apr 13, 2013, 4:40:17 PM4/13/13
to ang...@googlegroups.com
http://docs.angularjs.org/api/ng.directive:ngSrc ?

Cheers,
Pawel
> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to angular+u...@googlegroups.com.
> To post to this group, send email to ang...@googlegroups.com.
> Visit this group at http://groups.google.com/group/angular?hl=en-US.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
Looking for bootstrap-based widget library for AngularJS?
http://angular-ui.github.com/bootstrap/

tas pas

unread,
Apr 13, 2013, 5:29:22 PM4/13/13
to ang...@googlegroups.com
sorry, I made an error on typing, what I already have is:

<img ng-src="{{photoToBeLoaded}}">

Pawel Kozlowski

unread,
Apr 14, 2013, 5:09:54 AM4/14/13
to ang...@googlegroups.com
Hi!

So you will have to share code with your directive (ideally in a
plunker) so people can help more.

Cheers,
Pawel
> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to angular+u...@googlegroups.com.
> To post to this group, send email to ang...@googlegroups.com.
> Visit this group at http://groups.google.com/group/angular?hl=en-US.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
AngularJS book:
http://www.packtpub.com/angularjs-web-application-development/book
Reply all
Reply to author
Forward
0 new messages