Created
June 24, 2013 20:24
-
-
Save jodaka/5853300 to your computer and use it in GitHub Desktop.
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
var myModule = angular.module(...); | |
myModule.directive('directiveName', function factory(injectables) { | |
var directiveDefinitionObject = { | |
priority: 0, | |
template: '<div></div>', | |
templateUrl: 'directive.html', | |
replace: false, | |
transclude: false, | |
restrict: 'A', | |
scope: false, | |
controller: function($scope, $element, $attrs, $transclude, otherInjectables) { ... }, | |
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