Skip to content

Instantly share code, notes, and snippets.

@got5
Last active August 29, 2015 14:13
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 got5/19d7a41a8b81c1200bdf to your computer and use it in GitHub Desktop.
Save got5/19d7a41a8b81c1200bdf to your computer and use it in GitHub Desktop.
Slide 115 - Using the link function
angular.module('app',[]).directive('starRating', function () {
return {
link: function (scope, elem, attrs) {console.log("rating");
elem.addClass("rating " + attrs.rate);
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment