You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-9Lines changed: 11 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -278,7 +278,7 @@ Many of my styles have been from the many pair programming sessions [Ward Bell](
278
278
}
279
279
```
280
280
281
-
- Note: You can avoid any [jshint](http://www.jshint.com/) warnings by placing the comment below above the line of code.
281
+
- Note: You can avoid any [jshint](http://www.jshint.com/) warnings by placing the comment below above the line of code.
282
282
283
283
```javascript
284
284
/* jshint validthis: true */
@@ -335,7 +335,7 @@ Many of my styles have been from the many pair programming sessions [Ward Bell](
335
335
}
336
336
```
337
337
338
-
- Note: If the function is a 1 liner it consider keeping it right up top, as long as readability is not affected.
338
+
- Note: If the function is a 1 liner it consider keeping it right up top, as long as readability is not affected.
339
339
340
340
```javascript
341
341
/* avoid */
@@ -466,7 +466,7 @@ Many of my styles have been from the many pair programming sessions [Ward Bell](
466
466
467
467
- **Singletons**: Services are instantiated with the `new` keyword, use `this` for public methods and variables. Can also use a factory, which I recommend for consistency.
468
468
469
-
- Note: [All AngularJS services are singletons](https://docs.angularjs.org/guide/services). This means that there is only one instance of a given service per injector.
469
+
- Note: [All AngularJS services are singletons](https://docs.angularjs.org/guide/services). This means that there is only one instance of a given service per injector.
470
470
471
471
```javascript
472
472
// service
@@ -505,7 +505,7 @@ Many of my styles have been from the many pair programming sessions [Ward Bell](
505
505
506
506
- **Singletons**: Factories are singletons and return an object that contains the members of the service.
507
507
508
-
- Note: [All AngularJS services are singletons](https://docs.angularjs.org/guide/services).
508
+
- Note: [All AngularJS services are singletons](https://docs.angularjs.org/guide/services).
509
509
510
510
- **Public Members Up Top**: Expose the callable members of the service (it's interface) at the top, using a technique derived from the [Revealing Module Pattern](http://addyosmani.com/resources/essentialjsdesignpatterns/book/#revealingmodulepatternjavascript).
511
511
@@ -1235,19 +1235,21 @@ Many of my styles have been from the many pair programming sessions [Ward Bell](
1235
1235
1236
1236
- **Overall Guidelines**: Have a near term view of implementation and a long term vision. In other words, start small and but keep in mind on where the app is heading down the road. All of the app's code goes in a root folder named `app`. All content is 1 feature per file. Each controller, service, module, view is in its own file. Small deviations are OK for a set of small, short directives in a `directive.js` file. All 3rd party vendor scripts are stored in another root folder and not in the `app` folder. I didn't write them and I don't want them cluttering my app (`bower_components`, `scripts`, `lib`).
1237
1237
1238
+
- Note: Find more details and reasoning behind the structure at [this original post on application structure](http://www.johnpapa.net/angular-app-structuring-guidelines/).
1239
+
1238
1240
- **Layout**: Place components that define the overall layout of the application in a folder named `layout`. These may include a shell view and controller may act as the container for the app, navigation, menus, content areas, and other regions.
1239
1241
1240
-
- *Why?*: Organizes all layout in a single place re-used throughout the application.
1242
+
- *Why?*: Organizes all layout in a single place re-used throughout the application.
1241
1243
1242
1244
- **Folders-by-Feature Structure**: Create folders named for the feature they represent. When a folder grows to contain more than 7 files, start to consider creating a folder for them. Your threshold may be different, so adjust as needed.
1243
1245
1244
-
- *Why?*: A developer can locate the code, identify what each file represents at a glance, the structure is flat as can be, and there is no repetitive nor redundant names.
1246
+
- *Why?*: A developer can locate the code, identify what each file represents at a glance, the structure is flat as can be, and there is no repetitive nor redundant names.
1245
1247
1246
-
- *Why?*: The LIFT guidelines are all covered.
1248
+
- *Why?*: The LIFT guidelines are all covered.
1247
1249
1248
-
- *Why?*: Helps reduce the app from becoming cluttered through organizing the content and keeping them aligned with the LIFT guidelines.
1250
+
- *Why?*: Helps reduce the app from becoming cluttered through organizing the content and keeping them aligned with the LIFT guidelines.
1249
1251
1250
-
- *Why?*: When there are a lot of files (10+) locating them is easier with a consistent folder structures and more difficult in flat structures.
1252
+
- *Why?*: When there are a lot of files (10+) locating them is easier with a consistent folder structures and more difficult in flat structures.
0 commit comments