Created
August 5, 2014 01:21
-
-
Save eddiemonge/fdb7cb8b1fafbb4a2daf to your computer and use it in GitHub Desktop.
Angular Module style 2
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
'use strict'; | |
angular.module('myApp', [ | |
'widget.bye', | |
'widget.hello' | |
]); |
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
(function (angular) { | |
angular.module('widget.bye', []) | |
.directive('bye', function () { | |
return { | |
template: '<div></div>', | |
restrict: 'E', | |
link: function postLink(scope, element) { | |
element.text('this is the bye directive'); | |
} | |
}; | |
}); | |
}(window.angular)); |
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
(function (angular) { | |
angular.module('widget.hello', []) | |
.directive('hello', function () { | |
return { | |
template: '<div></div>', | |
restrict: 'E', | |
link: function postLink(scope, element) { | |
element.text('this is the hello directive'); | |
} | |
}; | |
}); | |
}(window.angular)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment