Skip to content

Commit 3503070

Browse files
committed
Merge branch 'master' of github.com:johnpapa/angularjs-styleguide
2 parents 644f0e4 + da7a44c commit 3503070

5 files changed

Lines changed: 1083 additions & 791 deletions

File tree

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ While this guide explains the *what*, *why* and *how*, I find it helpful to see
364364
}
365365
```
366366

367-
Note: You can avoid any [jshint](http://www.jshint.com/) warnings by placing the comment below above the line of code. However it is not needed when the function is named using UpperCasing, as this convention means it is a constructor function, which is what a controller is in Angular.
367+
Note: You can avoid any [jshint](http://www.jshint.com/) warnings by placing the comment above the line of code. However it is not needed when the function is named using UpperCasing, as this convention means it is a constructor function, which is what a controller is in Angular.
368368

369369
```javascript
370370
/* jshint validthis: true */
@@ -898,7 +898,7 @@ While this guide explains the *what*, *why* and *how*, I find it helpful to see
898898
899899
*Why?*: This makes it easier to test (mock or real) the data calls when testing a controller that uses a data service.
900900
901-
*Why?*: Data service implementation may have very specific code to handle the data repository. This may include headers, how to talk to the data, or other services such as $http. Separating the logic into a data service encapsulates this logic in a single place hiding the implementation from the outside consumers (perhaps a controller), also making it easier to change the implementation.
901+
*Why?*: Data service implementation may have very specific code to handle the data repository. This may include headers, how to talk to the data, or other services such as `$http`. Separating the logic into a data service encapsulates this logic in a single place hiding the implementation from the outside consumers (perhaps a controller), also making it easier to change the implementation.
902902
903903
```javascript
904904
/* recommended */
@@ -1010,7 +1010,7 @@ While this guide explains the *what*, *why* and *how*, I find it helpful to see
10101010
}
10111011
```
10121012
1013-
**[Back to top](#table-of-contents)**
1013+
**[Back to top](#table-of-contents)**
10141014
10151015
## Directives
10161016
### Limit 1 Per File
@@ -1022,7 +1022,7 @@ While this guide explains the *what*, *why* and *how*, I find it helpful to see
10221022
10231023
*Why?*: One directive per file is easy to maintain.
10241024
1025-
> Note: "**Best Practice**: Directives should clean up after themselves. You can use `element.on('$destroy', ...)` or `scope.$on('$destroy', ...)` to run a clean-up function when the directive is removed" ... from the Angular documentation
1025+
> Note: "**Best Practice**: Directives should clean up after themselves. You can use `element.on('$destroy', ...)` or `scope.$on('$destroy', ...)` to run a clean-up function when the directive is removed" ... from the Angular documentation.
10261026
10271027
```javascript
10281028
/* avoid */
@@ -1313,7 +1313,6 @@ While this guide explains the *what*, *why* and *how*, I find it helpful to see
13131313
**[Back to top](#table-of-contents)**
13141314
13151315
## Resolving Promises for a Controller
1316-
13171316
### Controller Activation Promises
13181317
###### [Style [Y080](#style-y080)]
13191318
@@ -1418,8 +1417,8 @@ While this guide explains the *what*, *why* and *how*, I find it helpful to see
14181417

14191418
Avengers.$inject = ['moviesPrepService'];
14201419
function Avengers(moviesPrepService) {
1421-
var vm = this;
1422-
vm.movies = moviesPrepService.movies;
1420+
var vm = this;
1421+
vm.movies = moviesPrepService.movies;
14231422
}
14241423
```
14251424
@@ -2188,6 +2187,7 @@ While this guide explains the *what*, *why* and *how*, I find it helpful to see
21882187
app.module.js
21892188
app.config.js
21902189
app.routes.js
2190+
directives.js
21912191
controllers/
21922192
attendees.js
21932193
session-detail.js
@@ -2328,12 +2328,12 @@ While this guide explains the *what*, *why* and *how*, I find it helpful to see
23282328
.module('app')
23292329
.run(runBlock);
23302330

2331-
runBlock.$inject = ['authenticator', 'translator'];
2331+
runBlock.$inject = ['authenticator', 'translator'];
23322332

2333-
function runBlock(authenticator, translator) {
2334-
authenticator.initialize();
2335-
translator.initialize();
2336-
}
2333+
function runBlock(authenticator, translator) {
2334+
authenticator.initialize();
2335+
translator.initialize();
2336+
}
23372337
```
23382338
23392339
**[Back to top](#table-of-contents)**
@@ -2850,6 +2850,8 @@ Use file templates or snippets to help follow consistent styles and patterns. He
28502850
ngdirective // creates an Angular directive
28512851
ngfactory // creates an Angular factory
28522852
ngmodule // creates an Angular module
2853+
ngservice // creates an Angular service
2854+
ngfilter // creates an Angular filter
28532855
```
28542856
28552857
### Brackets

0 commit comments

Comments
 (0)