#Angular Resources & Best Practices
John Papa's Styleguide - Required reading. We try to follow this blindly.
- The above styleguide has snippets for different editors
- Organize directories by feature, not type
- One Injectable "thing" per file.
- Thin controllers. Think of them as the View Model (vm), not a MVC controller.
- Avoid the
link
function and doing things withelement
(this isn't jQuery) - Business logic in Services (or Factories)
- Unit test all the logic.
- Use GULP for a build system
- Auto-adding
- Concatenation of js files
- Linting
- LESS css preprocessor
- ES6 Transpiliation
The next iteration of JavaScript. Not all features supported in all browsers (yet) so we "transpile"
Cool stuff we get:
- inline templates via multi-line strings
- fat arrows functions and other sugar
Things we maybe should be doing but aren't
- Module loader (WebPack or JSPM)