├── README.md ├── angular-app.sublime-snippet ├── angular-config.sublime-snippet ├── angular-controller.sublime-snippet ├── angular-directive.sublime-snippet ├── angular-factory.sublime-snippet ├── angular-function.sublime-snippet ├── angular-html.sublime-snippet ├── angular-ui-router.sublime-snippet ├── angular-watch.sublime-snippet ├── js-console-log-item.sublime-snippet ├── js-console-log.sublime-snippet └── js-for-loop.sublime-snippet /README.md: -------------------------------------------------------------------------------- 1 | # angular-snippets 2 | 3 | Clone this repo into your sublime user folder. Type the trigger(e.g. a-fact) and press tab to create the snippet. Use tab to edit the next field. 4 | 5 | ##Installation 6 | Linux: 7 | ``` 8 | cd "~/.config/sublime-text-3/Packages/User" 9 | git clone https://github.com/cyung/angular-snippets.git 10 | ``` 11 | 12 | 13 | Mac: 14 | ``` 15 | cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User 16 | git clone https://github.com/cyung/angular-snippets.git 17 | ``` 18 | 19 | 20 | Windows: 21 | ``` 22 | cd "C:/Users/%NAME%/AppData/Roaming/Sublime Text 3/Packages/User" 23 | git clone https://github.com/cyung/angular-snippets.git 24 | ``` 25 | 26 | ## Examples 27 | ``` 28 | a-app 29 | 30 | angular.module('app', ['']); 31 | ``` 32 | 33 | ``` 34 | a-ctrl 35 | 36 | (function() { 37 | 'use strict'; 38 | 39 | angular.module('app') 40 | .controller('Ctrl', Ctrl); 41 | 42 | function Ctrl() { 43 | var self = this; 44 | 45 | 46 | } 47 | 48 | })(); 49 | ``` 50 | 51 | ``` 52 | a-fact 53 | 54 | (function() { 55 | 'use strict'; 56 | 57 | angular.module('app') 58 | .factory('Factory', Factory); 59 | 60 | function Factory() { 61 | var services = { 62 | : 63 | }; 64 | 65 | return services; 66 | 67 | function () { 68 | 69 | } 70 | } 71 | 72 | })(); 73 | ``` 74 | 75 | ``` 76 | a-dir 77 | 78 | (function() { 79 | 'use strict'; 80 | 81 | angular.module('app') 82 | .directive('', ); 83 | 84 | function () { 85 | var directive = { 86 | template: '', 87 | link: link 88 | }; 89 | 90 | return directive; 91 | 92 | function link(scope, elem, attrs) { 93 | 94 | } 95 | } 96 | 97 | })(); 98 | ``` 99 | -------------------------------------------------------------------------------- /angular-app.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | a-app 6 | -------------------------------------------------------------------------------- /angular-config.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 17 | a-config 18 | -------------------------------------------------------------------------------- /angular-controller.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 19 | a-ctrl 20 | -------------------------------------------------------------------------------- /angular-directive.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 24 | a-dir 25 | -------------------------------------------------------------------------------- /angular-factory.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 25 | a-fact 26 | -------------------------------------------------------------------------------- /angular-function.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 7 | a-fun 8 | -------------------------------------------------------------------------------- /angular-html.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | ${1} 9 | 10 | 11 | 12 | 13 | 14 | 15 | ${3} 16 | 17 | 18 | 19 | ]]> 20 | a-html 21 | -------------------------------------------------------------------------------- /angular-ui-router.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 65 | a-router 66 | -------------------------------------------------------------------------------- /angular-watch.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 9 | a-watch 10 | 11 | -------------------------------------------------------------------------------- /js-console-log-item.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | clog-i 6 | 7 | -------------------------------------------------------------------------------- /js-console-log.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | clog 6 | -------------------------------------------------------------------------------- /js-for-loop.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 7 | for 8 | --------------------------------------------------------------------------------