Skip to content

Instantly share code, notes, and snippets.

@tangorri
Created November 18, 2013 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tangorri/7530224 to your computer and use it in GitHub Desktop.
Save tangorri/7530224 to your computer and use it in GitHub Desktop.
angular.module('App').directive('topCatIcon',
function(TopCategories) {
return {
link: function(scope, element, attrs) {
var selectedColor = '#ffffff';
var defaultColor = scope.topCat.colors.active;
//scope.$watch('TopCategories.selected', function(newsValue, oldValue) {
//if (TopCategories.selected.item == null) return;
element.css('color', scope.topCat.colors.active);
if (scope.topCat === TopCategories.selected.item)
element.css('color', '#FFFFFF');
scope.$digest();
//});
}
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment