简体   繁体   中英

angular 7 does not ask if to use routing when i create a new project

I was formerly using Angular version 6, now I have upgraded to 7. But when I try to create a new project in CLI using ng new [app-name] it just starts without asking if I want to include routing in my project or the styling.

PS: I have the latest version of Angular ie 7.0.2.

ng new {Project-name} command by default creates project without routing.

You need to set routing flag as true while creating project as below(by default this routing flag will be false),

ng new {Project-name} --routing=true

Go through angular documentation for more details

ng new --help run this command this will open up the things you can do while creating project.

在此处输入图像描述

Lets say I wanna create Angular project with routing and .scss styles then I would do it by the following command.

ng new project-name --routing=true --style=scss

I don't know why but when I tried to initialize the project using git bash on windows it doesn't prompt the questions about routing and style sheets. However, when I tried to use the same command in the terminal inside de VS code it worked. It's strange since both terminals runs with bash.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM