I am following an angular2 angular-cli tutorial which tells to run the following command:
ng generate route dashboard
But when I run it, it returns the following error:
Invalid blueprint: route
Is there any automatic way to be able to generate routes in angular?
The version of my angular-cli, when I run
$ ng version
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
@angular/cli: 1.0.0-rc.1
node: 7.2.1
os: darwin x64
@angular/common: 2.4.8
@angular/compiler: 2.4.8
@angular/core: 2.4.8
@angular/forms: 2.4.8
@angular/http: 2.4.8
@angular/platform-browser: 2.4.8
@angular/platform-browser-dynamic: 2.4.8
@angular/router: 3.4.8
@angular/cli: 1.0.0-rc.1
@angular/compiler-cli: 2.4.8
$ ng generate route dashboard
Invalid blueprint: route
You can't, this was disabled with the release of the new router a few months ago and the angular-cli devs haven't implemented it yet:
This function was disabled as the KarlosCode says in the beta versions. However, the second Release Candidate (1.0.0-rc.1) has already come out and is already enabled again. I recommend that you update as future versions will not contain changes that might break anything in your project. I have already updated my projects and have not had any problems.
Here you can find more information about how to update and about the changes made in Angular CLI.