Created
June 22, 2013 09:55
-
-
Save xtrasmal/5840232 to your computer and use it in GitHub Desktop.
angular directive
This file contains hidden or 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 (injectables) { | |
| return { | |
| restrict: 'A', | |
| template: '<div></div>', | |
| templateUrl: 'directive.html', | |
| replace: false, | |
| priority: 0, | |
| transclude: false, | |
| scope: false, | |
| terminal: false, | |
| require: 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) { ... } | |
| }; | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment