Versions
Angular CLI: 1.7.4
Node: 9.4.0
OS: win32 x64
Angular: 5.2.9
Repro steps
- Create a new project with
ng new first-project command
- Create a new component with
ng g c second command
Observed behavior
Ng-Cli produces a project with a first component named AppComponent with selector app-root
When we generate a second component using ng g c second, Ng-Cli produces a component SecondComponent with selector app-second in a folder named second.
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'app';
}
Desired behavior
It would be more consistent to name the root component RootComponent and keep app as a reference to application module only, just like other components are generated.
@Component({
selector: "app-root",
templateUrl: "./root.component.html",
styleUrls: ["./root.component.css"]
})
export class RootComponent {
title = 'app';
}
Mention any other details that might be useful (optional)
Versions
Repro steps
ng new first-projectcommandng g c secondcommandObserved behavior
Ng-Cli produces a project with a first component named AppComponent with selector
app-rootWhen we generate a second component using
ng g c second, Ng-Cli produces a componentSecondComponentwith selectorapp-secondin a folder namedsecond.Desired behavior
It would be more consistent to name the root component
RootComponentand keepappas a reference to application module only, just like other components are generated.Mention any other details that might be useful (optional)