Skip to content

Instantly share code, notes, and snippets.

@eddiemonge
Created August 5, 2014 01:21
Show Gist options
  • Save eddiemonge/fdb7cb8b1fafbb4a2daf to your computer and use it in GitHub Desktop.
Save eddiemonge/fdb7cb8b1fafbb4a2daf to your computer and use it in GitHub Desktop.
Angular Module style 2
'use strict';
angular.module('myApp', [
'widget.bye',
'widget.hello'
]);
(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));
(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