Saturday, May 9, 2015

Week 7 - Style Guides (Continued)

This week we will continue to refactor our code based on the opinionated style guide by Todd Moto.

Assignment
Fork the fiddle "AngularJS: A Walk-Through - Week 6" and
  • Name it "AngularJS: A Walk-Through - Week 7"
  • "Update" it and "Set as base". 

Assignment
Read through the last sections (starting from Filters) of the following style guide and apply fixes to the fiddle.  Some of the techniques are more advanced and thus not used in our simple example.

AngularJS StyleGuide by Todd Motto
<https://github.com/toddmotto/angularjs-styleguide>

Hints:
  • Routing resolves / Promises: We will address promises in a later week.
  • Performance / One-time binding syntax: Go through app to look for opportunities to use this feature.
  • Comment standards / jsDoc: Add some simple documentation to your app.

Assignment
Todd Motto suggests reading through another style guide; most of the ideas are duplicated.  Apply what is relevant.

angular-styleguide by John Papa
<https://github.com/johnpapa/angular-styleguide>

Hints:
  • Bindable Members Up Top (Y033) - Do it.
  • Manually Identify Dependencies (Y091) - Do it.
  • Routing (Y270) - Not using AngularJS Router in this example
  • Routing (Y271) - Move routing into separate files, e.g.
    • app.routes.js
    • marketing/marketing.routes.js
    • marketing/store.routes.js

Sample of Week Result
The result of this week is an AngularJS app, "AngularJS: A Walk-Through - Week 7" that will be used as a starting point for the next week.

AngularJS: A Walk-Through - Week 7
<http://jsfiddle.net/sckmkny/n1v22jjs/>

No comments:

Post a Comment