favicon directive

This commit is contained in:
Athou
2013-04-09 11:33:15 +02:00
parent 384bafa38e
commit 7c3d299805
2 changed files with 13 additions and 2 deletions

View File

@@ -17,7 +17,7 @@
</div>
<a ng-click="feedClick({id: feed.id})" class="feed-link"
ng-class="{selected: (feed.id == selectedId && selectedType == 'feed'), unread: feed.unread }">
<img ng-src="favicon?url={{feed.feedUrl}}" width="16" height="16"></img>
<favicon url="feed.feedUrl" />
{{formatFeedName({feed:feed})}}
</a>
</li>

View File

@@ -1,6 +1,17 @@
var module = angular.module('commafeed.directives', []);
app.directive('ngBlur', function() {
module.directive('favicon', function() {
return {
restrict : 'E',
scope : {
url : '='
},
replace : true,
template : '<img ng-src="favicon?url={{url}}" width="16" height="16"></img>'
}
});
module.directive('ngBlur', function() {
return {
restrict : 'A',
link : function(scope, elm, attrs) {