Open tgrant59 opened 9 years ago
Hi,
I had the same requirement but the module didn't support the feature.
So I had to make a tweak in angular-feed.js that I included in my project. In line 39, $attrs.url had to be replaced with $attrs.$observe('url', function(value){})...
With this modification on line 39, my code looks like.
$attrs.$observe('url', function(value){
feedService.getFeeds(value, $attrs.count).then(function(feedsObj) {
if ($attrs.templateUrl) {
$http.get($attrs.templateUrl, {cache: $templateCache}).success(function(templateHtml) {
renderTemplate(templateHtml, feedsObj);
});
}
else {
renderTemplate($templateCache.get('feed-list.html'), feedsObj);
}
}, function(error) {
console.error('Error loading feed ', error);
$scope.error = error;
renderTemplate($templateCache.get('feed-list.html'));
}).finally(function() {
$element.find('.spinner').slideUp();
$scope.$evalAsync('finishedLoading = true')
});
});
I wonder if the owner of this library can update this.
@nzalheart - Can you please create a PR? I can push this change to master.
very thank you for this edit :) I love you man ...
I am trying to bind a variable as part of the url parameter passed to the
feed
directive, but it refuses to bind.For example, calling this doesnt work:
but static urls do. Any thoughts on how to implement this functionality? Using
ng-attr-url
doesn't work either, so beyond that I'm out of ideas.Love the drop-in functionality of the directive btw.