Skip to content
This repository was archived by the owner on Mar 20, 2024. It is now read-only.

Commit 2a2fac5

Browse files
committed
Merge remote-tracking branch 'angulario/master'
2 parents 87117f6 + 19d0606 commit 2a2fac5

503 files changed

Lines changed: 15617 additions & 2404 deletions

File tree

Some content is hidden

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

gulpfile.js

Lines changed: 16 additions & 10 deletions
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() {
@@ -604,20 +604,19 @@ gulp.task('build-dart-cheatsheet', [], function() {
604604

605605
gulp.task('dartdoc', ['pub upgrade'], function() {
606606
const ngRepoPath = ngPathFor('dart');
607-
if (argv.fast && fs.existsSync(path.resolve(ngRepoPath, 'doc'))) {
608-
gutil.log('Skipping dartdoc: --fast flag enabled and "doc" dir exists');
607+
if (argv.fast && fs.existsSync(path.resolve(ngRepoPath, 'docs', 'api'))) {
608+
gutil.log('Skipping dartdoc: --fast flag enabled and "docs/api" dir exists');
609609
return true;
610610
}
611611
checkAngularProjectPath(ngRepoPath);
612612
const topLevelLibFilePath = path.resolve(ngRepoPath, 'lib', 'angular2.dart');
613613
const tmpPath = topLevelLibFilePath + '.disabled';
614-
if (!fs.existsSync(topLevelLibFilePath)) throw new Error(`Missing file: ${topLevelLibFilePath}`);
615-
fs.renameSync(topLevelLibFilePath, tmpPath);
614+
renameIfExistsSync(topLevelLibFilePath, tmpPath);
616615
gutil.log(`Hiding top-level angular2 library: ${topLevelLibFilePath}`);
617-
const dartdoc = spawnExt('dartdoc', ['--output', 'doc/api', '--add-crossdart'], { cwd: ngRepoPath});
616+
const dartdoc = spawnExt('dartdoc', ['--output', 'docs/api', '--add-crossdart'], { cwd: ngRepoPath});
618617
return dartdoc.promise.finally(() => {
619618
gutil.log(`Restoring top-level angular2 library: ${topLevelLibFilePath}`);
620-
fs.renameSync(tmpPath, topLevelLibFilePath);
619+
renameIfExistsSync(tmpPath, topLevelLibFilePath);
621620
})
622621
});
623622

@@ -1235,15 +1234,14 @@ function buildDartCheatsheet() {
12351234

12361235

12371236
function buildApiDocsForDart() {
1238-
const apiDir = 'api';
12391237
const vers = 'latest';
12401238
const dab = require('./tools/dart-api-builder/dab')(ANGULAR_IO_PROJECT_PATH);
12411239
const log = dab.log;
12421240

12431241
log.level = _dgeniLogLevel;
12441242
const dabInfo = dab.dartPkgConfigInfo;
1245-
dabInfo.ngIoDartApiDocPath = path.join(DOCS_PATH, 'dart', vers, apiDir);
1246-
dabInfo.ngDartDocPath = path.join(ngPathFor('dart'), 'doc', apiDir);
1243+
dabInfo.ngIoDartApiDocPath = path.join(DOCS_PATH, 'dart', vers, 'api');
1244+
dabInfo.ngDartDocPath = path.join(ngPathFor('dart'), 'docs', 'api');
12471245
// Exclude API entries for developer/internal libraries. Also exclude entries for
12481246
// the top-level catch all "angular2" library (otherwise every entry appears twice).
12491247
dabInfo.excludeLibRegExp = new RegExp(/^(?!angular2)|\.testing|_|codegen|^angular2$/);
@@ -1455,3 +1453,11 @@ function checkAngularProjectPath(_ngPath) {
14551453
if (fs.existsSync(ngPath)) return;
14561454
throw new Error('API related tasks require the angular2 repo to be at ' + ngPath);
14571455
}
1456+
1457+
function renameIfExistsSync(oldPath, newPath) {
1458+
if (fs.existsSync(oldPath)) {
1459+
fs.renameSync(oldPath, newPath);
1460+
} else {
1461+
gutil.log(`renameIfExistsSync cannot find file to rename: ${oldPath}`);
1462+
}
1463+
}

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",

public/_includes/_util-fns.jade

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@
3838
//- Location of sample code
3939
- var _liveLink = 'live link';
4040

41+
//- NgModule related
42+
- var _AppModuleVsAppComp = 'AppModule'
43+
- var _appModuleTsVsAppCompTs = 'app/app.module.ts'
44+
- var _appModuleTsVsMainTs = 'app/app.module.ts'
45+
- var _bootstrapModule = 'bootstrapModule'
46+
- var _moduleVsComp = 'module'
47+
- var _moduleVsRootComp = 'module'
48+
- var _platformBrowserDynamicVsBootStrap = 'platformBrowserDynamic'
49+
4150
//- Other
4251
- var _truthy = 'truthy';
4352
- var _falsey = 'falsey';
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

0 commit comments

Comments
 (0)