2015-08-21 23:13:31 -04:00
|
|
|
Naming Conventions in Angular2
|
|
|
|
---
|
|
|
|
|
2015-08-26 14:48:09 -04:00
|
|
|
In general Angular2 should follow TypeScript naming conventions.
|
|
|
|
See: https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines
|
2015-08-21 23:13:31 -04:00
|
|
|
|
|
|
|
|
|
|
|
Classes:
|
|
|
|
- Example: `Compiler`, `ApplicationMetadata`
|
|
|
|
- Camel case with first letter upper-case
|
|
|
|
- In general prefer single words. (This is so that when appending `Proto` or `Factory` the class
|
|
|
|
is still reasonable to work with.)
|
2015-08-26 14:48:09 -04:00
|
|
|
- Should not end with `Impl` or any other word which describes a specific implementation of an
|
2015-08-21 23:13:31 -04:00
|
|
|
interface.
|
|
|
|
|
|
|
|
|
|
|
|
Interfaces:
|
|
|
|
- Follow the same rules as Classes
|
2015-08-26 14:48:09 -04:00
|
|
|
- Should not have `I` or `Interface` in the name or any other way of identifying it as an interface.
|
2015-08-21 23:13:31 -04:00
|
|
|
|
|
|
|
|
|
|
|
Methods and functions:
|
|
|
|
- Example: `bootstrap`, `ngProbe`
|
|
|
|
- Should be camel case with first lower case
|
|
|
|
|
|
|
|
|
|
|
|
Constants
|
|
|
|
- Example: `CORE_DIRECTIVES`
|
|
|
|
- Should be all uppercase with SNAKE_CASE
|
|
|
|
|
|
|
|
|
|
|
|
|