Use file templates or snippets to help follow consistent styles and patterns. Here are templates and/or snippets for some of the web development editors and IDEs.
Angular snippets that follow these styles and guidelines.
TAB
ngcontroller // creates an Angular controller
ngdirective // creates an Angular directive
ngfactory // creates an Angular factory
ngmodule // creates an Angular module
ngservice // creates an Angular service
ngfilter // creates an Angular filter
Angular file templates that follow these styles and guidelines can be found at SideWaffle
Angular live templates that follow these styles and guidelines.
TAB
:// These are full file snippets containing an IIFE
ngapp // creates an Angular module setter
ngcontroller // creates an Angular controller
ngdirective // creates an Angular directive
ngfactory // creates an Angular factory
ngfilter // creates an Angular filter
ngservice // creates an Angular service
// These are partial snippets intended to be chained
ngconfig // defines a configuration phase function
ngmodule // creates an Angular module getter
ngroute // defines an Angular ngRoute 'when' definition
ngrun // defines a run phase function
ngstate // creates an Angular UI Router state definition
Individual templates are also available for download within the webstorm-angular-live-templates folder
Angular snippets that follow these styles and guidelines.
apm install angularjs-styleguide-snippets
or
In a JavaScript file type these commands followed by a TAB
ngcontroller // creates an Angular controller
ngdirective // creates an Angular directive
ngfactory // creates an Angular factory
ngmodule // creates an Angular module
ngservice // creates an Angular service
ngfilter // creates an Angular filter
Angular snippets that follow these styles and guidelines.
Settings
and then Import
Start Import
In a JavaScript file type these commands followed by a TAB
// These are full file snippets containing an IIFE
ngcontroller // creates an Angular controller
ngdirective // creates an Angular directive
ngfactory // creates an Angular factory
ngapp // creates an Angular module setter
ngservice // creates an Angular service
ngfilter // creates an Angular filter
// These are partial snippets intended to chained
ngmodule // creates an Angular module getter
ngstate // creates an Angular UI Router state definition
ngconfig // defines a configuration phase function
ngrun // defines a run phase function
ngwhen // defines an Angular ngRoute 'when' definition
ngtranslate // uses $translate service with its promise
vim snippets that follow these styles and guidelines.
vim UltiSnips snippets that follow these styles and guidelines.
ngcontroller // creates an Angular controller
ngdirective // creates an Angular directive
ngfactory // creates an Angular factory
ngmodule // creates an Angular module
ngservice // creates an Angular service
ngfilter // creates an Angular filter
Visual Studio Code snippets that follow these styles and guidelines.
ngcontroller // creates an Angular controller
ngdirective // creates an Angular directive
ngfactory // creates an Angular factory
ngmodule // creates an Angular module
ngservice // creates an Angular service
Emacs snippets that follow these styles and guidelines.
Note that yasnippet categorizes snippets by major mode, and there are several Emacs major modes for editing Javascript code. The snippets are in js2-mode
, and the other directories contain only a dotfile to reference them there.
M-x package-install RET yasnippet RET
)yas-snippet-dirs
ngcontroller // creates an Angular controller
ngdirective // creates an Angular directive
ngfactory // creates an Angular factory
ngmodule // creates an Angular module
ngservice // creates an Angular service
ngfilter // creates an Angular filter