Angular File Vs Components Class Naming Conventions
- Forums
- Angular
- Angular File Vs Components Class Naming Conventions
this short page will describe how you should name your files and your components accordingly [4641], Last Updated: Mon Jun 24, 2024
Angular2
Tue Jan 31, 2017
0 Comments
406 Visits
Naming conventions
File name: hero-detail.component.ts
class name: HeroDetailComponent
NOTE
that the file name is using lower dash case (AKA kebab-case). This way you don't have to worry about case sensitivity on the server or in source control.
All your component names should end in "Component"
import { Component, Input } from '@angular/core';
look at the contents of the hero-detail.component.ts file:
@Component({
selector: 'my-hero-detail',
})
export class HeroDetailComponent {
}