-
Notifications
You must be signed in to change notification settings - Fork 0
Best Practices
SD1 Component files and names do not add "Component" suffix. Why: Smaller file names for style, template, component files.
SD2 Goes with SD1, name component models as entity.model.ts
and model class/interface as EntityModel
.
AT1 All component names end in "Component".
AT2 All component file names end in ".component". For example, export class AppComponent {}
for app.component.ts
. Another example export class HeroDetailComponent {}
for hero-detail.component.ts
. Note starter deviation from this rule as SD1.
AT3 Spell our file names in lower dash case (AKA "kebab case") so we don't worry about case sensitivity on the server or in source control.
AT4 Adopted a convention in which we spell the name of a service in lowercase followed by .service
. If the service name were multi-word, we'd spell the base filename with lower dash case (AKA kebab-case). The SpecialSuperHeroService
would be defined in the special-super-hero.service.ts
file.
AT5 Prefix selectors with project name/shorthand to avoid naming clashes. So AngularPages
project selectors are prefixed with ap-selector-name
.
enjoy — AngularClass
Learn AngularJS, Angular 2, and Modern Web Development from the best. Looking for corporate Angular training, want to host us, or Angular consulting? [email protected]