Created
November 24, 2014 13:02
-
-
Save EmmanuelDemey/1662dafec3c751ecb8a1 to your computer and use it in GitHub Desktop.
Slide 114 - Using the link function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div ng-app="app"> | |
| <div class='html-content'><p star-rating data-rate="two">2 comments</p></div></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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