Skip to content

Instantly share code, notes, and snippets.

@alatzl
Last active August 29, 2015 14:19
Show Gist options
  • Save alatzl/32f1b0cca7c38ceb2795 to your computer and use it in GitHub Desktop.
Save alatzl/32f1b0cca7c38ceb2795 to your computer and use it in GitHub Desktop.
Writing Angular with Migration in Mind: Ex. 3
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