Advertisement
Guest User

Untitled

a guest
May 29th, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. angular.module('myModule')
  2. .directive('roar', function() {
  3. return {
  4. restrict: 'E',
  5. scope: {},
  6. controller: roarCtrl,
  7. controllerAs: dinoRoar,
  8. bindToController: {
  9. dinoType: '@'
  10. }
  11. template: '<p>I am a {{ dinoRoar.getType }}, hear me ROAR!</p>',
  12. };
  13.  
  14. function roarCtrl() {
  15. this.getType = function() {
  16. return this.dino.species;
  17. };
  18. }
  19. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement