Well, I actually solved it by myself. The list I'm using comes from a json
file and it doesn't have a image as a property so I added it myself at
runtime.
The code looks something like this
this.list = _list.map(function(currVal, idx, array) {
currVal['src'] = {};
currVal['src'] = '';
return currVal;
});
After that, in the directive I changed the $timeout to this (from this
directive I have access to the scope which contains the iterating item)
var src = attrs.imgSrc;
$timeout(function() {
// This way I'm editing the item from the json and not the DOM directly
$scope.item.src = src;
}, 500);
Later in my HTML
<img style="min-width:1px;" ng-src="{{item.src}}" />
And this did the trick.
It was much easier than I thought.
I'll edit the plnkr in case somebody can find it useful.
PS : This just solves the second issue, I still can't trigger a scroll
event when filtering. I'll comeback when I found the solution.
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.