@phoenix-plugin-registry/brackets-angular-snippets
v0.1.2
Published
A collection of AngularJS snippets for Brackets.
Downloads
3
Readme
Angular Snippets for Brackets
A collection of Angular snippets for Brackets editor.
Install
Git Clone
- Under main menu select Help > Show Extensions Folder
- Git clone this repository inside the folder user.
Extension Manager
- Under main menu select File > Extension Manager...
- Search for "Angular snippets"
- Click "Install"
How to use
- Enable Angular Snippets Under main menu select Edit > Enable Angular Snippets or open the Preferences File and add "angular-snippets.enabled": true.
- Enter a snippet and hit the Tab key.
Snippets list
- ngmodule =>
angular.module('{name}', [])
- ngconfig =>
config([function () {
}])
- ngconfig[$routeProvider]
config(['$routeProvider', function ($routeProvider) {
$routeProvider.when('/{route}', {
templateUrl: '{name}.html',
controller: '{Nane}'
}).otherwise({ redirectTo: '/{route}' });
}])
- ngwhen
when('/{route}', {
templateUrl: '{name}.html',
controller: '{Name}'
})
- ngotherwise
otherwise({ redirectTo: '/{route}' })
- ngrun
run([function () {
}])
- ngcontroller =>
controller('{Name}', ['$scope', function ($scope) {
}])
- ngservice =>
service('{name}', [function () {
}])
- ngfactory =>
factory('{name}', [function () {
return {
};
}])
- ngdirective =>
directive('{name}', [function () {
return {
restrict: '{A}',
link: function (scope, element, attrs) {
}
};
}])
Directives available options
Directives can be customized at will. Here is a list of all the available options:
- scope
- template
- templateUrl
- transclude
NOTE: Options are sperated by commas (,) without spaces.
For example:
- ngdirective[template] will create snippet:
directive('directive-name', [function () {
return {
restrict: '{A}',
template: '',
link: function (scope, element, attrs) {
}
};
}]).
- ngdirective[scope,template,transclude] will create snippet:
directive('directive-name', [function () {
return {
restrict: '{A}',
scope: {},
template: '',
transclude: true,
link: function (scope, element, attrs) {
}
};
}])
Snippets combinations
You can combine snippets together like this:
ngmodule.ngconfig[$routeProvider].ngcontroller.ngdirective[scope,template].ngfactory will create snippet:
angular.module('{name}', []).controller('{Name}', ['$scope', function ($scope) {
}]).directive('{name}', [function () {
return {
restrict: '{A}',
scope: {},
template: '',
link: function (scope, element, attrs) {
}
};
}]).factory('{name}', [function () {
return {
};
}]);