Skip to content

Commit 843e09f

Browse files
committed
Merge pull request johnpapa#240 from johnpapa/develop
added task automation for module files
2 parents 2e64de2 + 0060435 commit 843e09f

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ While this guide explains the *what*, *why* and *how*, I find it helpful to see
4848
1. [Constants](#constants)
4949
1. [File Templates and Snippets](#file-templates-and-snippets)
5050
1. [Yeoman Generator](#yeoman-generator)
51+
1. [Task Automation](#task-automation)
5152
1. [AngularJS Docs](#angularjs-docs)
5253
1. [Contributing](#contributing)
5354
1. [License](#license)
@@ -2731,6 +2732,31 @@ You can use the [HotTowel yeoman generator](http://jpapa.me/yohottowel) to creat
27312732
yo hottowel helloWorld
27322733
```
27332734
2735+
**[Back to top](#table-of-contents)**
2736+
2737+
## Task Automation
2738+
Use [Gulp](http://gulpjs.com) or [Grunt](http://gruntjs.com) for creating automated tasks. Gulp leans to code over configuration while Grunt leans to configuration over code. I personally prefer Gulp as I feel it is easier to read and write, but both are excellent.
2739+
2740+
###### [Style [Y400](#style-y400)]
2741+
2742+
- Use task automation to list module definition files `*.module.js` before all other application JavaScript files.
2743+
2744+
*Why?*: Angular needs the module definitions to be registered before they are used.
2745+
2746+
*Why?*: Naming modules with a specific pattern such as `*.module.js` makes it easy to grab them with a glob and list them first.
2747+
2748+
```javascript
2749+
var clientApp = './src/client/app/';
2750+
2751+
// Always grab module files first
2752+
var files = [
2753+
clientApp + '**/*.module.js',
2754+
clientApp + '**/*.js'
2755+
];
2756+
```
2757+
2758+
**[Back to top](#table-of-contents)**
2759+
27342760
## AngularJS docs
27352761
For anything else, API reference, check the [Angular documentation](//docs.angularjs.org/api).
27362762

0 commit comments

Comments
 (0)