Created
April 28, 2014 15:10
-
-
Save 0xBADC0FFEE/11374993 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
directive('$directiveName$', function factory($injectables$) { | |
return { | |
// priority: 0, | |
// restrict: 'A', // Attribute (default): <div my-directive="exp"></div> | |
// restrict: 'E', // Element name: <my-directive></my-directive> | |
// restrict: 'C', // Class: <div class="my-directive: exp;"></div> | |
// template: '<div></div>', | |
// or | |
// template: function (tElement, tAttrs) {}, | |
// or | |
// templateUrl: 'directive.html', | |
// or | |
// templateUrl: function(tElement, tAttrs) {}, | |
// replace: true, // the template will replace the current element | |
// replace: false, // the template will replace the contents of the current element | |
// transclude: true, | |
// transclude: 'element', | |
// scope: false, | |
// or | |
// scope: { | |
// attr: '@attr', // one way binding | |
// attr: '=attr', // two way binding | |
// attr: '&attr' // expression | |
// }, | |
// controller: function ($scope, $element, $attrs, $transclude, otherInjectables) {}, | |
// controllerAs: 'stringAlias', | |
// require: 'siblingDirectiveName', | |
// or | |
// require: [ | |
// '^parentDirectiveName', | |
// '?optionalDirectiveName', | |
// '?^optionalParent' | |
// ], | |
// compile: function compile (tElement, tAttrs, transclude /*DEPRECATED*/) { | |
// return function postLink () {}; | |
// }, | |
// or | |
// 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, controller, transcludeFn) {} | |
// or | |
// link: { | |
// pre: function preLink(scope, iElement, iAttrs, controller) { ... }, | |
// post: function postLink(scope, iElement, iAttrs, controller) { ... } | |
// } | |
}; | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment