Last active
August 29, 2015 14:19
-
-
Save alatzl/6451d61ee817fa2b9e14 to your computer and use it in GitHub Desktop.
Writing Angular with Migration in Mind: Ex. 4
This file contains 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: {}, | |
controller: roarCtrl, | |
controllerAs: dinoRoar, | |
bindToController: { | |
dinoType: '@' | |
} | |
template: '<p>I am a {{ dinoRoar.getType }}, hear me ROAR!</p>', | |
}; | |
function roarCtrl() { | |
this.getType = function() { | |
return this.dino.species; | |
}; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment