1

Are you allowed to rename the AppComponent to something else?

From the default, AppComponent:

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.css']
})
export class AppComponent {
    title = 'app';
}

To a new name, StockholmComponent:

@Component({
    selector: 'stockholm',
    templateUrl: './stockholm.component.html',
    styleUrls: ['./stockholm.component.css']
})
export class StockholmComponent {
    title = 'Stockholm';
}
Arne Evertsson
  • 19,693
  • 20
  • 69
  • 84

1 Answers1

3

Definitely. Any valid TypeScript class name can be used that doesn't conflict with other imports.

AppComponent is only used in examples to make it clear that it is the root component without also adding @NgModule({ bootstrap: AppComponent, ...})

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567