diff --git a/packages/@angular/cli/blueprints/ng/files/__path__/app/app.component.html b/packages/@angular/cli/blueprints/ng/files/__path__/app/app.component.html index 4b7217733e92..f72e0dc37c24 100644 --- a/packages/@angular/cli/blueprints/ng/files/__path__/app/app.component.html +++ b/packages/@angular/cli/blueprints/ng/files/__path__/app/app.component.html @@ -1,4 +1,21 @@ -

- {{title}} -

<% if (routing) { %> + +
+

+ Welcome to {{title}}!! +

+ +
+

Here are some links to help you start:

+ +<% if (routing) { %> <% } %> diff --git a/packages/@angular/cli/blueprints/ng/files/__path__/app/app.component.spec.ts b/packages/@angular/cli/blueprints/ng/files/__path__/app/app.component.spec.ts index 7f6fef4348cd..d61b4a947135 100644 --- a/packages/@angular/cli/blueprints/ng/files/__path__/app/app.component.spec.ts +++ b/packages/@angular/cli/blueprints/ng/files/__path__/app/app.component.spec.ts @@ -21,16 +21,16 @@ describe('AppComponent', () => { expect(app).toBeTruthy(); })); - it(`should have as title '<%= prefix %> works!'`, async(() => { + it(`should have as title '<%= prefix %>'`, async(() => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.debugElement.componentInstance; - expect(app.title).toEqual('<%= prefix %> works!'); + expect(app.title).toEqual('<%= prefix %>'); })); it('should render title in a h1 tag', async(() => { const fixture = TestBed.createComponent(AppComponent); fixture.detectChanges(); const compiled = fixture.debugElement.nativeElement; - expect(compiled.querySelector('h1').textContent).toContain('<%= prefix %> works!'); + expect(compiled.querySelector('h1').textContent).toContain('Welcome to <%= prefix %>!!'); })); }); diff --git a/packages/@angular/cli/blueprints/ng/files/__path__/app/app.component.ts b/packages/@angular/cli/blueprints/ng/files/__path__/app/app.component.ts index 385275f6972f..b047b38a8947 100644 --- a/packages/@angular/cli/blueprints/ng/files/__path__/app/app.component.ts +++ b/packages/@angular/cli/blueprints/ng/files/__path__/app/app.component.ts @@ -13,5 +13,5 @@ import { Component } from '@angular/core'; styleUrls: ['./app.component.<%= styleExt %>']<% } %> }) export class AppComponent { - title = '<%= prefix %> works!'; + title = '<%= prefix %>'; } diff --git a/packages/@angular/cli/blueprints/ng/files/__path__/app/app.module.ts b/packages/@angular/cli/blueprints/ng/files/__path__/app/app.module.ts index d1993885a14f..2c4bc05c64e6 100644 --- a/packages/@angular/cli/blueprints/ng/files/__path__/app/app.module.ts +++ b/packages/@angular/cli/blueprints/ng/files/__path__/app/app.module.ts @@ -1,7 +1,5 @@ import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; -import { FormsModule } from '@angular/forms'; -import { HttpModule } from '@angular/http'; <% if (routing) { %> import { AppRoutingModule } from './app-routing.module';<% } %> import { AppComponent } from './app.component'; @@ -11,9 +9,7 @@ import { AppComponent } from './app.component'; AppComponent ], imports: [ - BrowserModule, - FormsModule, - HttpModule<% if (routing) { %>, + BrowserModule<% if (routing) { %>, AppRoutingModule<% } %> ], providers: [], diff --git a/packages/@angular/cli/blueprints/ng/files/__path__/index.html b/packages/@angular/cli/blueprints/ng/files/__path__/index.html index f4916b4ba356..4d12a74b3a92 100644 --- a/packages/@angular/cli/blueprints/ng/files/__path__/index.html +++ b/packages/@angular/cli/blueprints/ng/files/__path__/index.html @@ -9,6 +9,6 @@ - <<%= prefix %>-root>Loading...-root> + <<%= prefix %>-root>-root> diff --git a/packages/@angular/cli/blueprints/ng/files/e2e/app.e2e-spec.ts b/packages/@angular/cli/blueprints/ng/files/e2e/app.e2e-spec.ts index e427603edac4..cb0dc57d711d 100644 --- a/packages/@angular/cli/blueprints/ng/files/e2e/app.e2e-spec.ts +++ b/packages/@angular/cli/blueprints/ng/files/e2e/app.e2e-spec.ts @@ -7,8 +7,8 @@ describe('<%= htmlComponentName %> App', () => { page = new <%= jsComponentName %>Page(); }); - it('should display message saying app works', () => { + it('should display welcome message', () => { page.navigateTo(); - expect(page.getParagraphText()).toEqual('<%= prefix %> works!'); + expect(page.getParagraphText()).toEqual('Welcome to <%= prefix %>!!'); }); }); diff --git a/packages/@angular/cli/blueprints/ng/files/package.json b/packages/@angular/cli/blueprints/ng/files/package.json index 77858ca9c676..0ed61594df18 100644 --- a/packages/@angular/cli/blueprints/ng/files/package.json +++ b/packages/@angular/cli/blueprints/ng/files/package.json @@ -12,11 +12,13 @@ }, "private": true, "dependencies": { + "@angular/animations": "^4.0.0", "@angular/common": "^4.0.0", "@angular/compiler": "^4.0.0", "@angular/core": "^4.0.0", "@angular/forms": "^4.0.0", "@angular/http": "^4.0.0", + "@angular/language-service": "^4.0.0", "@angular/platform-browser": "^4.0.0", "@angular/platform-browser-dynamic": "^4.0.0", "@angular/router": "^4.0.0", diff --git a/tests/e2e/tests/build/assets.ts b/tests/e2e/tests/build/assets.ts index e353d77351d9..ce15e48a81c0 100644 --- a/tests/e2e/tests/build/assets.ts +++ b/tests/e2e/tests/build/assets.ts @@ -49,6 +49,27 @@ export default function () { .then(() => expectToFail(() => expectFileToExist('dist/assets/.gitkeep'))) // Update app to test assets are present. .then(_ => !ejected && writeMultipleFiles({ + 'src/app/app.module.ts': ` + import { BrowserModule } from '@angular/platform-browser'; + import { NgModule } from '@angular/core'; + import { FormsModule } from '@angular/forms'; + import { HttpModule } from '@angular/http'; + import { AppComponent } from './app.component'; + + @NgModule({ + declarations: [ + AppComponent + ], + imports: [ + BrowserModule, + FormsModule, + HttpModule + ], + providers: [], + bootstrap: [AppComponent] + }) + export class AppModule { } + `, 'src/app/app.component.ts': ` import { Component } from '@angular/core'; import { Http, Response } from '@angular/http'; @@ -112,5 +133,5 @@ export default function () { });`, })) .then(() => !ejected && ng('test', '--single-run')) - .then(() => !ejected && ng('e2e', '--no-progress')); + .then(() => !ejected && ng('e2e')); } diff --git a/tests/e2e/tests/misc/default-port.ts b/tests/e2e/tests/misc/default-port.ts index b525cf9867f0..8ab525c455d6 100644 --- a/tests/e2e/tests/misc/default-port.ts +++ b/tests/e2e/tests/misc/default-port.ts @@ -12,7 +12,7 @@ export default function() { .then(() => ngServe()) .then(() => request('http://localhost:4201/')) .then(body => { - if (!body.match(/Loading...<\/app-root>/)) { + if (!body.match(/<\/app-root>/)) { throw new Error('Response does not match expected value.'); } }) diff --git a/tests/e2e/tests/misc/deploy-url.ts b/tests/e2e/tests/misc/deploy-url.ts index b43672e0eb84..929e982064f8 100644 --- a/tests/e2e/tests/misc/deploy-url.ts +++ b/tests/e2e/tests/misc/deploy-url.ts @@ -10,7 +10,7 @@ export default function () { .then(() => expectToFail(() => request('http://localhost:4200'))) .then(() => request('http://localhost:4200/deployurl')) .then(body => { - if (!body.match(/Loading...<\/app-root>/)) { + if (!body.match(/<\/app-root>/)) { throw new Error('Response does not match expected value.'); } }) diff --git a/tests/e2e/tests/misc/fallback.ts b/tests/e2e/tests/misc/fallback.ts index 12b27cf9d8d9..6c3cefe86864 100644 --- a/tests/e2e/tests/misc/fallback.ts +++ b/tests/e2e/tests/misc/fallback.ts @@ -11,7 +11,7 @@ export default function () { .then(() => ngServe()) .then(() => request('http://localhost:4200/')) .then(body => { - if (!body.match(/Loading...<\/app-root>/)) { + if (!body.match(/<\/app-root>/)) { throw new Error('Response does not match expected value.'); } }) @@ -25,7 +25,7 @@ export default function () { .then(() => ngServe()) .then(() => request('http://localhost:4200/')) .then(body => { - if (!body.match(/Loading...<\/app-root>/)) { + if (!body.match(/<\/app-root>/)) { throw new Error('Response does not match expected value.'); } }) diff --git a/tests/e2e/tests/misc/live-reload.ts b/tests/e2e/tests/misc/live-reload.ts index e82b8c929a18..bcd2fa799c81 100644 --- a/tests/e2e/tests/misc/live-reload.ts +++ b/tests/e2e/tests/misc/live-reload.ts @@ -36,6 +36,26 @@ export default function () { return Promise.resolve() .then(_ => writeMultipleFiles({ + 'src/app/app.module.ts': ` + import { BrowserModule } from '@angular/platform-browser'; + import { NgModule } from '@angular/core'; + import { FormsModule } from '@angular/forms'; + import { HttpModule } from '@angular/http'; + import { AppComponent } from './app.component'; + @NgModule({ + declarations: [ + AppComponent + ], + imports: [ + BrowserModule, + FormsModule, + HttpModule + ], + providers: [], + bootstrap: [AppComponent] + }) + export class AppModule { } + `, // e2e test that just opens the page and waits, so that the app runs. './e2e/app.e2e-spec.ts': ` import { browser } from 'protractor'; diff --git a/tests/e2e/tests/misc/ssl-default-config.ts b/tests/e2e/tests/misc/ssl-default-config.ts index 94d134879999..6dc287a1dd50 100644 --- a/tests/e2e/tests/misc/ssl-default-config.ts +++ b/tests/e2e/tests/misc/ssl-default-config.ts @@ -12,7 +12,7 @@ export default function() { .then(() => ngServe()) .then(() => request('https://localhost:4200/')) .then(body => { - if (!body.match(/Loading...<\/app-root>/)) { + if (!body.match(/<\/app-root>/)) { throw new Error('Response does not match expected value.'); } }) diff --git a/tests/e2e/tests/misc/ssl-default.ts b/tests/e2e/tests/misc/ssl-default.ts index e16ec54291c9..80c3952b16ab 100644 --- a/tests/e2e/tests/misc/ssl-default.ts +++ b/tests/e2e/tests/misc/ssl-default.ts @@ -8,7 +8,7 @@ export default function() { .then(() => ngServe('--ssl', 'true')) .then(() => request('https://localhost:4200/')) .then(body => { - if (!body.match(/Loading...<\/app-root>/)) { + if (!body.match(/<\/app-root>/)) { throw new Error('Response does not match expected value.'); } }) diff --git a/tests/e2e/tests/misc/ssl-with-cert-config.ts b/tests/e2e/tests/misc/ssl-with-cert-config.ts index afb2e132c192..605c98726922 100644 --- a/tests/e2e/tests/misc/ssl-with-cert-config.ts +++ b/tests/e2e/tests/misc/ssl-with-cert-config.ts @@ -17,7 +17,7 @@ export default function() { .then(() => ngServe()) .then(() => request('https://localhost:4200/')) .then(body => { - if (!body.match(/Loading...<\/app-root>/)) { + if (!body.match(/<\/app-root>/)) { throw new Error('Response does not match expected value.'); } }) diff --git a/tests/e2e/tests/misc/ssl-with-cert.ts b/tests/e2e/tests/misc/ssl-with-cert.ts index 3930c91625fb..e15aaed9d2b8 100644 --- a/tests/e2e/tests/misc/ssl-with-cert.ts +++ b/tests/e2e/tests/misc/ssl-with-cert.ts @@ -13,7 +13,7 @@ export default function() { )) .then(() => request('https://localhost:4200/')) .then(body => { - if (!body.match(/Loading...<\/app-root>/)) { + if (!body.match(/<\/app-root>/)) { throw new Error('Response does not match expected value.'); } })