Closed
Description
Tasklist:
- add a
angular-cli/router-config.ts
to the scaffold. This is part of the project. The content of this file should have a comment at the top to say to not touch this file, and export aCliRouteConfig
(open to name suggestions). - add a
README.md
to theangular-cli
directory to explain that this is generated code. We will use this for other things such as providers and third party libraries. - import the
CliRouteConfig
in the defaultsrc/app/__name__.ts
. The code should look something like [1]. -
ng generate route
needs to add the route info to therouter-config.ts
. This includes importing the new route and adding it to theCliRouteConfig
array. -
ng generate route
should have a flag--no-route-generation
(open to suggestions) that avoid the addition of it to theCliRouteConfig
array. -
README.md
documentation for this. - e2e tests for it.
[1]
@Component({
selector: '<%= htmlComponentName %>-app',
providers: [],
templateUrl: 'app/<%= htmlComponentName %>.html',
directives: [ROUTER_DIRECTIVES],
pipes: []
})
@RouteConfig([
].concat(CliRouteConfig))
export class <%= jsComponentName %>App {
defaultMeaning: number = 42;
meaningOfLife(meaning?: number) {
return `The meaning of life is ${meaning || this.defaultMeaning}`;
}
}