Answer the question
In order to leave comments, you need to log in
How to run snippet directives for angulsrjs?
Sublime text 3 has a directive snippet that I can't seem to get to run.
Below is the snippet itself, if someone has come across a similar one, fill it in correctly -
<div my-directive="good"></div>
.directive('', ['', function(){
// Runs during compile
return {
// name: '',
// priority: 1,
// terminal: true,
// scope: {}, // {} = isolate, true = child, false/undefined = no change
// controller: function($scope, $element, $attrs, $transclude) {},
// require: 'ngModel', // Array = multiple requires, ? = optional, ^ = check parent elements
// restrict: 'A', // E = Element, A = Attribute, C = Class, M = Comment
// template: '',
// templateUrl: '',
// replace: true,
// transclude: true,
// compile: function(tElement, tAttrs, function transclude(function(scope, cloneLinkingFn){ return function linking(scope, elm, attrs){}})),
link: function($scope, iElm, iAttrs, controller) {
}
};
}]);
Answer the question
In order to leave comments, you need to log in
https://docs.angularjs.org/guide/directive
If we fill it out for you, you'd be kind enough to decorate:
Updated
Damn... didn't think you'd do that well... now I can't get away...
what's going on here. The first empty quotes are the name of the directive. Written in camel case, used with underscore (as it happened with DOM).
.directive('someDirective', fn);
// <some-directive></some-directive>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question