From d16265952d5e6efd2b43c6c0b19ff805f6593511 Mon Sep 17 00:00:00 2001 From: Hans Larsen Date: Tue, 7 Feb 2017 13:45:04 -0800 Subject: [PATCH] feat(@angular/cli): add ng4 option to ng new This allows to create a project with Angular 4 in the template. Also fixes a few issues with ng4. --- packages/@angular/cli/tasks/init.ts | 1 + tests/e2e/setup/500-create-project.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/@angular/cli/tasks/init.ts b/packages/@angular/cli/tasks/init.ts index d8a8492715f5..8342d096f5bd 100644 --- a/packages/@angular/cli/tasks/init.ts +++ b/packages/@angular/cli/tasks/init.ts @@ -71,6 +71,7 @@ export default Task.extend({ inlineStyle: commandOptions.inlineStyle, inlineTemplate: commandOptions.inlineTemplate, ignoredUpdateFiles: ['favicon.ico'], + ng4: commandOptions.ng4, skipGit: commandOptions.skipGit, skipTests: commandOptions.skipTests }; diff --git a/tests/e2e/setup/500-create-project.ts b/tests/e2e/setup/500-create-project.ts index 290dfc6c0bfb..c88df6cc1d8a 100644 --- a/tests/e2e/setup/500-create-project.ts +++ b/tests/e2e/setup/500-create-project.ts @@ -24,7 +24,7 @@ export default function() { } else { // Otherwise create a project from scratch. createProject = Promise.resolve() - .then(() => ng('new', 'test-project', '--skip-npm', argv['ng4'] ? '--ng4' : '--')) + .then(() => ng('new', 'test-project', '--skip-npm', ...(argv['ng4'] ? ['--ng4'] : []))) .then(() => expectFileToExist(join(process.cwd(), 'test-project'))) .then(() => process.chdir('./test-project')); }