Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit d79adb2

Browse files
petebacondarwinnaomiblack
authored andcommitted
docs(rc5): update docs and plunkers for rc5
1 parent 2fb503d commit d79adb2

File tree

374 files changed

+4604
-2286
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

374 files changed

+4604
-2286
lines changed

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ gulp.task('build-dart-api-docs', ['_shred-api-examples', 'dartdoc'], function()
595595
});
596596

597597
gulp.task('build-plunkers', ['_copy-example-boilerplate'], function() {
598-
return plunkerBuilder.buildPlunkers(EXAMPLES_PATH, LIVE_EXAMPLES_PATH, { errFn: gutil.log });
598+
return plunkerBuilder.buildPlunkers(EXAMPLES_PATH, LIVE_EXAMPLES_PATH, { errFn: gutil.log, build: argv.build });
599599
});
600600

601601
gulp.task('build-dart-cheatsheet', [], function() {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"browser-sync": "^2.9.3",
3333
"canonical-path": "0.0.2",
3434
"cheerio": "^0.20.0",
35-
"codelyzer": "0.0.22",
35+
"codelyzer": "0.0.26",
3636
"cross-spawn": "^4.0.0",
3737
"del": "^2.2.0",
3838
"dgeni": "^0.4.0",
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { NgModule } from '@angular/core';
2+
import { BrowserModule } from '@angular/platform-browser';
3+
4+
import { HeroTeamBuilderComponent } from './hero-team-builder.component';
5+
import { HeroListBasicComponent } from './hero-list-basic.component';
6+
import { HeroListInlineStylesComponent } from './hero-list-inline-styles.component';
7+
import { HeroListEnterLeaveComponent } from './hero-list-enter-leave.component';
8+
import { HeroListEnterLeaveStatesComponent } from './hero-list-enter-leave-states.component';
9+
import { HeroListCombinedTransitionsComponent } from './hero-list-combined-transitions.component';
10+
import { HeroListTwowayComponent } from './hero-list-twoway.component';
11+
import { HeroListAutoComponent } from './hero-list-auto.component';
12+
import { HeroListGroupsComponent } from './hero-list-groups.component';
13+
import { HeroListMultistepComponent } from './hero-list-multistep.component';
14+
import { HeroListTimingsComponent } from './hero-list-timings.component';
15+
16+
@NgModule({
17+
imports: [ BrowserModule ],
18+
declarations: [
19+
HeroTeamBuilderComponent,
20+
HeroListBasicComponent,
21+
HeroListInlineStylesComponent,
22+
HeroListCombinedTransitionsComponent,
23+
HeroListTwowayComponent,
24+
HeroListEnterLeaveComponent,
25+
HeroListEnterLeaveStatesComponent,
26+
HeroListAutoComponent,
27+
HeroListTimingsComponent,
28+
HeroListMultistepComponent,
29+
HeroListGroupsComponent
30+
],
31+
bootstrap: [ HeroTeamBuilderComponent ]
32+
})
33+
export class AppModule { }

public/docs/_examples/animations/ts/app/hero-team-builder.component.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
import { Component } from '@angular/core';
22

33
import { Heroes } from './hero.service';
4-
import { HeroListBasicComponent } from './hero-list-basic.component';
5-
import { HeroListInlineStylesComponent } from './hero-list-inline-styles.component';
6-
import { HeroListEnterLeaveComponent } from './hero-list-enter-leave.component';
7-
import { HeroListEnterLeaveStatesComponent } from './hero-list-enter-leave-states.component';
8-
import { HeroListCombinedTransitionsComponent } from './hero-list-combined-transitions.component';
9-
import { HeroListTwowayComponent } from './hero-list-twoway.component';
10-
import { HeroListAutoComponent } from './hero-list-auto.component';
11-
import { HeroListGroupsComponent } from './hero-list-groups.component';
12-
import { HeroListMultistepComponent } from './hero-list-multistep.component';
13-
import { HeroListTimingsComponent } from './hero-list-timings.component';
144

155
@Component({
166
selector: 'hero-team-builder',
@@ -97,18 +87,6 @@ import { HeroListTimingsComponent } from './hero-list-timings.component';
9787
min-height: 6em;
9888
}
9989
`],
100-
directives: [
101-
HeroListBasicComponent,
102-
HeroListInlineStylesComponent,
103-
HeroListCombinedTransitionsComponent,
104-
HeroListTwowayComponent,
105-
HeroListEnterLeaveComponent,
106-
HeroListEnterLeaveStatesComponent,
107-
HeroListAutoComponent,
108-
HeroListTimingsComponent,
109-
HeroListMultistepComponent,
110-
HeroListGroupsComponent
111-
],
11290
providers: [Heroes]
11391
})
11492
export class HeroTeamBuilderComponent {
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { bootstrap } from '@angular/platform-browser-dynamic';
1+
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
2+
import { AppModule } from './app.module';
23

3-
import { HeroTeamBuilderComponent } from './hero-team-builder.component';
4-
5-
bootstrap(HeroTeamBuilderComponent);
4+
platformBrowserDynamic().bootstrapModule(AppModule);

public/docs/_examples/architecture/ts/app/app.component.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
// #docregion import
22
import { Component } from '@angular/core';
33
// #enddocregion import
4-
import { HeroListComponent } from './hero-list.component';
5-
import { SalesTaxComponent } from './sales-tax.component';
64

75
@Component({
86
selector: 'my-app',
97
template: `
10-
<hero-list></hero-list>
11-
<sales-tax></sales-tax>
12-
`,
13-
directives: [HeroListComponent, SalesTaxComponent]
8+
<hero-list></hero-list>
9+
<sales-tax></sales-tax>
10+
`
1411
})
1512
// #docregion export
1613
export class AppComponent { }
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { BrowserModule } from '@angular/platform-browser';
2+
import { FormsModule } from '@angular/forms';
3+
// #docregion imports
4+
import { NgModule } from '@angular/core';
5+
import { AppComponent } from './app.component';
6+
// #enddocregion imports
7+
import { HeroDetailComponent } from './hero-detail.component';
8+
import { HeroListComponent } from './hero-list.component';
9+
import { SalesTaxComponent } from './sales-tax.component';
10+
import { HeroService } from './hero.service';
11+
import { BackendService } from './backend.service';
12+
import { Logger } from './logger.service';
13+
14+
@NgModule({
15+
imports: [
16+
BrowserModule,
17+
FormsModule
18+
],
19+
declarations: [
20+
AppComponent,
21+
HeroDetailComponent,
22+
HeroListComponent,
23+
SalesTaxComponent
24+
],
25+
// #docregion providers
26+
providers: [
27+
BackendService,
28+
HeroService,
29+
Logger
30+
],
31+
// #enddocregion providers
32+
bootstrap: [ AppComponent ]
33+
})
34+
// #docregion export
35+
export class AppModule { }
36+
// #enddocregion export

public/docs/_examples/architecture/ts/app/hero-detail.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import { Hero } from './hero';
44

55
@Component({
66
selector: 'hero-detail',
7-
templateUrl: 'app/hero-detail.component.html',
8-
directives: [HeroDetailComponent]
7+
templateUrl: 'app/hero-detail.component.html'
98
})
109
export class HeroDetailComponent {
1110
@Input() hero: Hero;

public/docs/_examples/architecture/ts/app/hero-list.component.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
import { Component, OnInit } from '@angular/core';
22

33
import { Hero } from './hero';
4-
import { HeroDetailComponent } from './hero-detail.component';
54
import { HeroService } from './hero.service';
65

7-
// #docregion metadata
6+
// #docregion metadata, providers
87
@Component({
98
selector: 'hero-list',
109
templateUrl: 'app/hero-list.component.html',
11-
directives: [HeroDetailComponent],
12-
// #docregion providers
13-
providers: [HeroService]
14-
// #enddocregion providers
10+
providers: [ HeroService ]
1511
})
12+
// #enddocregion providers
1613
// #docregion class
1714
export class HeroListComponent implements OnInit {
1815
// #enddocregion metadata
Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
import { bootstrap } from '@angular/platform-browser-dynamic';
2-
// #docregion import
3-
import { AppComponent } from './app.component';
4-
// #enddocregion import
5-
import { HeroService } from './hero.service';
6-
import { BackendService } from './backend.service';
7-
import { Logger } from './logger.service';
1+
// #docregion
2+
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3+
import { AppModule } from './app.module';
84

9-
// #docregion bootstrap
10-
bootstrap(AppComponent, [BackendService, HeroService, Logger]);
11-
// #enddocregion bootstrap
5+
platformBrowserDynamic().bootstrapModule(AppModule);
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// #docplaster
2+
// A mini-application
3+
import { Injectable } from '@angular/core';
4+
5+
@Injectable()
6+
export class Logger {
7+
log(message: string) { console.log(message); }
8+
}
9+
10+
// #docregion import-core-component
11+
import { Component } from '@angular/core';
12+
// #enddocregion import-core-component
13+
14+
@Component({
15+
selector: 'my-app',
16+
template: 'Welcome to Angular 2'
17+
})
18+
export class AppComponent {
19+
constructor(logger: Logger) {
20+
logger.log('Let the fun begin!');
21+
}
22+
}
23+
24+
// #docregion module
25+
import { NgModule } from '@angular/core';
26+
// #docregion import-browser-module
27+
import { BrowserModule } from '@angular/platform-browser';
28+
// #enddocregion import-browser-module
29+
@NgModule({
30+
// #docregion ngmodule-imports
31+
imports: [ BrowserModule ],
32+
// #enddocregion ngmodule-imports
33+
providers: [ Logger ],
34+
declarations: [ AppComponent ],
35+
exports: [ AppComponent ],
36+
bootstrap: [ AppComponent ]
37+
})
38+
// #docregion export
39+
export class AppModule { }
40+
// #enddocregion export
41+
// #enddocregion module
42+
43+
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
44+
45+
platformBrowserDynamic().bootstrapModule(AppModule);

public/docs/_examples/architecture/ts/app/sales-tax.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { TaxRateService } from './tax-rate.service';
1414
{{ getTax(amountBox.value) | currency:'USD':true:'1.2-2' }}
1515
</div>
1616
`,
17-
providers: [SalesTaxService, TaxRateService]
17+
providers: [SalesTaxService, TaxRateService]
1818
})
1919
export class SalesTaxComponent {
2020
constructor(private salesTaxService: SalesTaxService) { }
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
<!DOCTYPE html>
2-
<!-- #docregion -->
32
<html>
43
<head>
5-
<base href="/">
6-
<title>Router Sample v.3</title>
4+
<title>Architecture of Angular 2</title>
75
<meta charset="UTF-8">
86
<meta name="viewport" content="width=device-width, initial-scale=1">
97
<link rel="stylesheet" href="styles.css">
@@ -17,15 +15,12 @@
1715

1816
<script src="systemjs.config.js"></script>
1917
<script>
20-
System.import('app/main.3') // <----- ONLY CHANGE
21-
.catch(function(err){ console.error(err); });
18+
System.import('app/mini-app').catch(function(err){ console.error(err); });
2219
</script>
2320
</head>
2421

2522
<body>
26-
<h1>Milestone 3</h1>
27-
<my-app>loading...</my-app>
23+
<my-app>Loading...</my-app>
2824
</body>
2925

3026
</html>
31-
<!-- #enddocregion -->
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
// #docregion
22
import { Component } from '@angular/core';
33

4-
import { HighlightDirective } from './highlight.directive';
5-
64
@Component({
75
selector: 'my-app',
8-
templateUrl: 'app/app.component.html',
9-
directives: [HighlightDirective]
6+
templateUrl: 'app/app.component.html'
107
})
118

129
export class AppComponent { }
13-
1410
// #enddocregion
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// #docregion
2+
import { NgModule } from '@angular/core';
3+
import { BrowserModule } from '@angular/platform-browser';
4+
5+
import { AppComponent } from './app.component';
6+
import { HighlightDirective } from './highlight.directive';
7+
8+
@NgModule({
9+
imports: [ BrowserModule ],
10+
declarations: [
11+
AppComponent,
12+
HighlightDirective
13+
],
14+
bootstrap: [ AppComponent ]
15+
})
16+
export class AppModule { }
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// #docregion
2-
import { bootstrap } from '@angular/platform-browser-dynamic';
3-
4-
import { AppComponent } from './app.component';
5-
6-
bootstrap(AppComponent);
2+
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3+
import { AppModule } from './app.module';
74

5+
platformBrowserDynamic().bootstrapModule(AppModule);

public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.component.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
import { Component } from '@angular/core';
2-
import { ROUTER_DIRECTIVES } from '@angular/router';
32

4-
import { MovieListComponent } from './movie-list.component';
53
import { MovieService } from './movie.service';
64
import { IMovie } from './movie';
7-
import { StringSafeDatePipe } from './date.pipe';
85

96
@Component({
107
selector: 'my-app',
118
templateUrl: 'app/app.component.html',
129
styleUrls: ['app/app.component.css'],
13-
directives: [MovieListComponent, ROUTER_DIRECTIVES],
14-
pipes: [StringSafeDatePipe],
1510
providers: [MovieService]
1611
})
1712
export class AppComponent {
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// #docregion
2+
import { NgModule } from '@angular/core';
3+
import { BrowserModule } from '@angular/platform-browser';
4+
5+
import { AppComponent } from './app.component';
6+
7+
@NgModule({
8+
imports: [ BrowserModule ],
9+
declarations: [ AppComponent ],
10+
bootstrap: [ AppComponent ]
11+
})
12+
export class AppModule { }
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// #docregion
2+
import { NgModule } from '@angular/core';
3+
import { BrowserModule } from '@angular/platform-browser';
4+
import { FormsModule } from '@angular/forms';
5+
import { RouterModule } from '@angular/router';
6+
7+
import { AppComponent } from './app.component';
8+
import { MovieListComponent } from './movie-list.component';
9+
import { routes } from './app.routes';
10+
11+
@NgModule({
12+
imports: [
13+
BrowserModule,
14+
FormsModule,
15+
RouterModule.forRoot(routes, {})
16+
],
17+
declarations: [
18+
AppComponent,
19+
MovieListComponent
20+
],
21+
bootstrap: [ AppComponent ]
22+
})
23+
export class AppModule { }

0 commit comments

Comments
 (0)