Skip to content

Commit 0ac878a

Browse files
sumitarorafilipesilva
authored andcommitted
feat(@angular/cli): new project landing page (#6144)
Fix #5928 Fix #6125
1 parent a3bf529 commit 0ac878a

16 files changed

+80
-24
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
1-
<h1>
2-
{{title}}
3-
</h1><% if (routing) { %>
1+
<!--The whole content below can be removed with the new code.-->
2+
<div style="text-align:center">
3+
<h1>
4+
Welcome to {{title}}!!
5+
</h1>
6+
<img width="300" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxOS4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCAyNTAgMjUwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAyNTAgMjUwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDojREQwMDMxO30NCgkuc3Qxe2ZpbGw6I0MzMDAyRjt9DQoJLnN0MntmaWxsOiNGRkZGRkY7fQ0KPC9zdHlsZT4NCjxnPg0KCTxwb2x5Z29uIGNsYXNzPSJzdDAiIHBvaW50cz0iMTI1LDMwIDEyNSwzMCAxMjUsMzAgMzEuOSw2My4yIDQ2LjEsMTg2LjMgMTI1LDIzMCAxMjUsMjMwIDEyNSwyMzAgMjAzLjksMTg2LjMgMjE4LjEsNjMuMiAJIi8+DQoJPHBvbHlnb24gY2xhc3M9InN0MSIgcG9pbnRzPSIxMjUsMzAgMTI1LDUyLjIgMTI1LDUyLjEgMTI1LDE1My40IDEyNSwxNTMuNCAxMjUsMjMwIDEyNSwyMzAgMjAzLjksMTg2LjMgMjE4LjEsNjMuMiAxMjUsMzAgCSIvPg0KCTxwYXRoIGNsYXNzPSJzdDIiIGQ9Ik0xMjUsNTIuMUw2Ni44LDE4Mi42aDBoMjEuN2gwbDExLjctMjkuMmg0OS40bDExLjcsMjkuMmgwaDIxLjdoMEwxMjUsNTIuMUwxMjUsNTIuMUwxMjUsNTIuMUwxMjUsNTIuMQ0KCQlMMTI1LDUyLjF6IE0xNDIsMTM1LjRIMTA4bDE3LTQwLjlMMTQyLDEzNS40eiIvPg0KPC9nPg0KPC9zdmc+DQo=" />
7+
</div>
8+
<h2>Here are some links to help you start: </h2>
9+
<ul>
10+
<li>
11+
<h2><a target="_blank" href="https://angular.io/docs/ts/latest/tutorial/">Tour of Heros</a></h2>
12+
</li>
13+
<li>
14+
<h2><a target="_blank" href="https://github.com/angular/angular-cli/wiki">CLI Documentation</a></h2>
15+
</li>
16+
<li>
17+
<h2><a target="_blank" href="http://angularjs.blogspot.ca/">Angular blog</a></h2>
18+
</li>
19+
</ul>
20+
<% if (routing) { %>
421
<router-outlet></router-outlet><% } %>

packages/@angular/cli/blueprints/ng/files/__path__/app/app.component.spec.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ describe('AppComponent', () => {
2121
expect(app).toBeTruthy();
2222
}));
2323

24-
it(`should have as title '<%= prefix %> works!'`, async(() => {
24+
it(`should have as title '<%= prefix %>'`, async(() => {
2525
const fixture = TestBed.createComponent(AppComponent);
2626
const app = fixture.debugElement.componentInstance;
27-
expect(app.title).toEqual('<%= prefix %> works!');
27+
expect(app.title).toEqual('<%= prefix %>');
2828
}));
2929

3030
it('should render title in a h1 tag', async(() => {
3131
const fixture = TestBed.createComponent(AppComponent);
3232
fixture.detectChanges();
3333
const compiled = fixture.debugElement.nativeElement;
34-
expect(compiled.querySelector('h1').textContent).toContain('<%= prefix %> works!');
34+
expect(compiled.querySelector('h1').textContent).toContain('Welcome to <%= prefix %>!!');
3535
}));
3636
});

packages/@angular/cli/blueprints/ng/files/__path__/app/app.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ import { Component } from '@angular/core';
1313
styleUrls: ['./app.component.<%= styleExt %>']<% } %>
1414
})
1515
export class AppComponent {
16-
title = '<%= prefix %> works!';
16+
title = '<%= prefix %>';
1717
}

packages/@angular/cli/blueprints/ng/files/__path__/app/app.module.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { BrowserModule } from '@angular/platform-browser';
22
import { NgModule } from '@angular/core';
3-
import { FormsModule } from '@angular/forms';
4-
import { HttpModule } from '@angular/http';
53
<% if (routing) { %>
64
import { AppRoutingModule } from './app-routing.module';<% } %>
75
import { AppComponent } from './app.component';
@@ -11,9 +9,7 @@ import { AppComponent } from './app.component';
119
AppComponent
1210
],
1311
imports: [
14-
BrowserModule,
15-
FormsModule,
16-
HttpModule<% if (routing) { %>,
12+
BrowserModule<% if (routing) { %>,
1713
AppRoutingModule<% } %>
1814
],
1915
providers: [],

packages/@angular/cli/blueprints/ng/files/__path__/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
<link rel="icon" type="image/x-icon" href="favicon.ico">
1010
</head>
1111
<body>
12-
<<%= prefix %>-root>Loading...</<%= prefix %>-root>
12+
<<%= prefix %>-root></<%= prefix %>-root>
1313
</body>
1414
</html>

packages/@angular/cli/blueprints/ng/files/e2e/app.e2e-spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ describe('<%= htmlComponentName %> App', () => {
77
page = new <%= jsComponentName %>Page();
88
});
99

10-
it('should display message saying app works', () => {
10+
it('should display welcome message', () => {
1111
page.navigateTo();
12-
expect(page.getParagraphText()).toEqual('<%= prefix %> works!');
12+
expect(page.getParagraphText()).toEqual('Welcome to <%= prefix %>!!');
1313
});
1414
});

packages/@angular/cli/blueprints/ng/files/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@
1212
},
1313
"private": true,
1414
"dependencies": {
15+
"@angular/animations": "^4.0.0",
1516
"@angular/common": "^4.0.0",
1617
"@angular/compiler": "^4.0.0",
1718
"@angular/core": "^4.0.0",
1819
"@angular/forms": "^4.0.0",
1920
"@angular/http": "^4.0.0",
21+
"@angular/language-service": "^4.0.0",
2022
"@angular/platform-browser": "^4.0.0",
2123
"@angular/platform-browser-dynamic": "^4.0.0",
2224
"@angular/router": "^4.0.0",

tests/e2e/tests/build/assets.ts

+22-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,27 @@ export default function () {
4949
.then(() => expectToFail(() => expectFileToExist('dist/assets/.gitkeep')))
5050
// Update app to test assets are present.
5151
.then(_ => !ejected && writeMultipleFiles({
52+
'src/app/app.module.ts': `
53+
import { BrowserModule } from '@angular/platform-browser';
54+
import { NgModule } from '@angular/core';
55+
import { FormsModule } from '@angular/forms';
56+
import { HttpModule } from '@angular/http';
57+
import { AppComponent } from './app.component';
58+
59+
@NgModule({
60+
declarations: [
61+
AppComponent
62+
],
63+
imports: [
64+
BrowserModule,
65+
FormsModule,
66+
HttpModule
67+
],
68+
providers: [],
69+
bootstrap: [AppComponent]
70+
})
71+
export class AppModule { }
72+
`,
5273
'src/app/app.component.ts': `
5374
import { Component } from '@angular/core';
5475
import { Http, Response } from '@angular/http';
@@ -112,5 +133,5 @@ export default function () {
112133
});`,
113134
}))
114135
.then(() => !ejected && ng('test', '--single-run'))
115-
.then(() => !ejected && ng('e2e', '--no-progress'));
136+
.then(() => !ejected && ng('e2e'));
116137
}

tests/e2e/tests/misc/default-port.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function() {
1212
.then(() => ngServe())
1313
.then(() => request('http://localhost:4201/'))
1414
.then(body => {
15-
if (!body.match(/<app-root>Loading...<\/app-root>/)) {
15+
if (!body.match(/<app-root><\/app-root>/)) {
1616
throw new Error('Response does not match expected value.');
1717
}
1818
})

tests/e2e/tests/misc/deploy-url.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default function () {
1010
.then(() => expectToFail(() => request('http://localhost:4200')))
1111
.then(() => request('http://localhost:4200/deployurl'))
1212
.then(body => {
13-
if (!body.match(/<app-root>Loading...<\/app-root>/)) {
13+
if (!body.match(/<app-root><\/app-root>/)) {
1414
throw new Error('Response does not match expected value.');
1515
}
1616
})

tests/e2e/tests/misc/fallback.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default function () {
1111
.then(() => ngServe())
1212
.then(() => request('http://localhost:4200/'))
1313
.then(body => {
14-
if (!body.match(/<app-root>Loading...<\/app-root>/)) {
14+
if (!body.match(/<app-root><\/app-root>/)) {
1515
throw new Error('Response does not match expected value.');
1616
}
1717
})
@@ -25,7 +25,7 @@ export default function () {
2525
.then(() => ngServe())
2626
.then(() => request('http://localhost:4200/'))
2727
.then(body => {
28-
if (!body.match(/<app-root>Loading...<\/app-root>/)) {
28+
if (!body.match(/<app-root><\/app-root>/)) {
2929
throw new Error('Response does not match expected value.');
3030
}
3131
})

tests/e2e/tests/misc/live-reload.ts

+20
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,26 @@ export default function () {
3636

3737
return Promise.resolve()
3838
.then(_ => writeMultipleFiles({
39+
'src/app/app.module.ts': `
40+
import { BrowserModule } from '@angular/platform-browser';
41+
import { NgModule } from '@angular/core';
42+
import { FormsModule } from '@angular/forms';
43+
import { HttpModule } from '@angular/http';
44+
import { AppComponent } from './app.component';
45+
@NgModule({
46+
declarations: [
47+
AppComponent
48+
],
49+
imports: [
50+
BrowserModule,
51+
FormsModule,
52+
HttpModule
53+
],
54+
providers: [],
55+
bootstrap: [AppComponent]
56+
})
57+
export class AppModule { }
58+
`,
3959
// e2e test that just opens the page and waits, so that the app runs.
4060
'./e2e/app.e2e-spec.ts': `
4161
import { browser } from 'protractor';

tests/e2e/tests/misc/ssl-default-config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function() {
1212
.then(() => ngServe())
1313
.then(() => request('https://localhost:4200/'))
1414
.then(body => {
15-
if (!body.match(/<app-root>Loading...<\/app-root>/)) {
15+
if (!body.match(/<app-root><\/app-root>/)) {
1616
throw new Error('Response does not match expected value.');
1717
}
1818
})

tests/e2e/tests/misc/ssl-default.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default function() {
88
.then(() => ngServe('--ssl', 'true'))
99
.then(() => request('https://localhost:4200/'))
1010
.then(body => {
11-
if (!body.match(/<app-root>Loading...<\/app-root>/)) {
11+
if (!body.match(/<app-root><\/app-root>/)) {
1212
throw new Error('Response does not match expected value.');
1313
}
1414
})

tests/e2e/tests/misc/ssl-with-cert-config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default function() {
1717
.then(() => ngServe())
1818
.then(() => request('https://localhost:4200/'))
1919
.then(body => {
20-
if (!body.match(/<app-root>Loading...<\/app-root>/)) {
20+
if (!body.match(/<app-root><\/app-root>/)) {
2121
throw new Error('Response does not match expected value.');
2222
}
2323
})

tests/e2e/tests/misc/ssl-with-cert.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default function() {
1313
))
1414
.then(() => request('https://localhost:4200/'))
1515
.then(body => {
16-
if (!body.match(/<app-root>Loading...<\/app-root>/)) {
16+
if (!body.match(/<app-root><\/app-root>/)) {
1717
throw new Error('Response does not match expected value.');
1818
}
1919
})

0 commit comments

Comments
 (0)