Created
November 18, 2013 22:22
-
-
Save selahlynch/7536443 to your computer and use it in GitHub Desktop.
directive pseudo code
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('namespaceDirectiveName', function factory(injectables) { | |
var directiveDefinitionObject = { | |
restrict: string, | |
priority: number, | |
template: string, | |
templateUrl: string, | |
replace: bool, | |
transclude: bool, | |
scope: bool or object, | |
controller: function controllerConstructor($scope, | |
$element, | |
$attrs, | |
$transclude), | |
require: string, | |
link: function postLink(scope, iElement, iAttrs) { ... }, | |
compile: function compile(tElement, tAttrs, transclude) { | |
return { | |
pre: function preLink(scope, iElement, iAttrs, controller) { ... }, | |
post: function postLink(scope, iElement, iAttrs, controller) { ... } | |
} | |
} | |
}; | |
return directiveDefinitionObject; | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment