Skip to content

Instantly share code, notes, and snippets.

@slvdrog
Created August 16, 2012 17:10
Show Gist options
  • Select an option

  • Save slvdrog/3371750 to your computer and use it in GitHub Desktop.

Select an option

Save slvdrog/3371750 to your computer and use it in GitHub Desktop.
Angular Plugin - Long Method
var myModule = angular.module('myModule');
myModule.directive('directiveName', function factory(injectables) {
var directiveDefinitionObject = {
priority: 0,
template: '<div></div>',
templateUrl: 'directive.html',
replace: false,
transclude: false,
restrict: 'A',
scope: false,
compile: function compile(tElement, tAttrs, transclude) {
return {
pre: function preLink(scope, iElement, iAttrs, controller) { ... },
post: function postLink(scope, iElement, iAttrs, controller) { ... }
}
},
link: function postLink(scope, iElement, iAttrs) { ... }
};
return directiveDefinitionObject;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment