4

Now that Angular-Cli v.1.0.0 and Angular v.4.0.0 are official, default project creation with ng new generates Angular v.4 project.

For some time I'd still like to create Angular v.2 projects by default. Is there a global config setting of Angular-Cli for that?

UPDATE:
Apparently Angular-Cli team rushed for the release and there is a bug. Right now it's not even possible to create an Angular 2 project in command prompt using --ng2 let along setting it as a global default.

I've opened an issue for this.

1 Answer 1

3

They've answered the issue I've created, Angular-Cli team won't support creation of Angular 2 projects from v.1.0.0 on.

Those who'd like to create an Angular 2 app with new CLI, just create new project normally and change package.json Angular module versions to "older" one that works for you.

Sign up to request clarification or add additional context in comments.

4 Comments

What all should be edited in package.json file of such newly created angular project using latest angular-cli? What's the workflow?
The section of package.json that contains "dependencies": {, needs to be edited (with versions for example 2.4.10, latest of 2.x) instead of default ones that come when you do ng new ProjectName (4.x.x)
@Bogac I suppose we do that only for @angular/* dependencies. Also, how about devDependenices?
@DilipRajBaral good point. I'd say "same for devDependencies" but one question comes to my mind: Angular Dev Dependencies are mostly CLI related, therefore I don't know how that will work to have latest CLI on your machine but using an older version of related package in project. You need to try.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.