Last active
August 29, 2015 14:19
-
-
Save alatzl/32f1b0cca7c38ceb2795 to your computer and use it in GitHub Desktop.
Writing Angular with Migration in Mind: Ex. 3
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('myModule') | |
.directive('roar', function() { | |
return { | |
restrict: 'E', | |
scope: { | |
dinoType: '@' | |
}, | |
template: '<p>I am a {{ getType }}, hear me ROAR!</p>', | |
link: function(scope) { | |
scope.getType = function() { | |
return scope.dino.species; | |
} | |
} | |
}; | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment