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

Commit bebcc76

Browse files
committed
Merge branch 'docs-style-guide-4' of github.com:IdeaBlade/angular.io into docs-style-guide-4
2 parents 956fd76 + 17071a9 commit bebcc76

File tree

70 files changed

+780
-117
lines changed

Some content is hidden

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

70 files changed

+780
-117
lines changed

gulpfile.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ var globby = require("globby");
2525
var treeKill = require("tree-kill");
2626
var blc = require("broken-link-checker");
2727

28+
var tslint = require('gulp-tslint');
29+
2830
// TODO:
2931
// 1. Think about using runSequence
3032
// 2. Think about using spawn instead of exec in case of long error messages.
@@ -45,6 +47,7 @@ var exampleZipper = require(path.resolve(TOOLS_PATH, '_example-zipper/exampleZip
4547
var plunkerBuilder = require(path.resolve(TOOLS_PATH, 'plunker-builder/plunkerBuilder'));
4648
var fsUtils = require(path.resolve(TOOLS_PATH, 'fs-utils/fsUtils'));
4749

50+
4851
var _devguideShredOptions = {
4952
examplesDir: path.join(DOCS_PATH, '_examples'),
5053
fragmentsDir: path.join(DOCS_PATH, '_fragments'),
@@ -498,6 +501,20 @@ gulp.task('_zip-examples', function() {
498501
});
499502

500503

504+
// Linting
505+
506+
gulp.task('lint', function() {
507+
return gulp.src(['./public/docs/_examples/style-guide/ts/**/*.ts'])
508+
.pipe(tslint({
509+
rulesDirectory: ['node_modules/codelyzer'],
510+
configuration: require('./tslint.json')
511+
}))
512+
.pipe(tslint.report('prose', {
513+
summarizeFailureOutput: true
514+
}));
515+
});
516+
517+
501518
// Helper functions
502519

503520
function harpCompile() {

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
"harp": "harp",
1010
"live-server": "live-server",
1111
"test-api-builder": "jasmine-node tools/api-builder",
12-
1312
"protractor": "protractor"
1413
},
1514
"repository": {
@@ -28,10 +27,11 @@
2827
"devDependencies": {
2928
"archiver": "^0.16.0",
3029
"assert-plus": "^0.1.5",
31-
"broken-link-checker":"0.7.0",
30+
"broken-link-checker": "0.7.0",
3231
"browser-sync": "^2.9.3",
3332
"canonical-path": "0.0.2",
3433
"cross-spawn": "^2.1.0",
34+
"codelyzer": "0.0.18",
3535
"del": "^1.2.0",
3636
"dgeni": "^0.4.0",
3737
"dgeni-packages": "^0.11.1",
@@ -42,6 +42,7 @@
4242
"gulp": "^3.5.6",
4343
"gulp-env": "0.4.0",
4444
"gulp-task-listing": "^1.0.1",
45+
"gulp-tslint": "^4.3.5",
4546
"gulp-util": "^3.0.6",
4647
"gulp-watch": "^4.3.4",
4748
"harp": "^0.20.3",
@@ -66,6 +67,7 @@
6667
"protractor": "^3.0.0",
6768
"q": "^1.4.1",
6869
"tree-kill": "^1.0.0",
70+
"tslint": "^3.2.2",
6971
"typescript": "1.7.3",
7072
"yargs": "^3.23.0"
7173
},

public/_includes/_hero.jade

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ if current.path[4] && current.path[3] == 'api'
88
- var textFormat = 'is-standard-case'
99

1010
header(class="hero background-sky")
11-
h1(class="hero-title text-display-1 #{textFormat}") #{headerTitle}
12-
if useBadges
11+
div(class="inner-header")
12+
h1(class="hero-title text-display-1 #{textFormat}") #{headerTitle}
13+
if useBadges
1314
span(class="badges")
1415
if docType
1516
span(class="status-badge").

public/docs/_examples/cb-dependency-injection/ts/app/main.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ import { bootstrap } from 'angular2/platform/browser';
33
import { provide } from 'angular2/core';
44
import { XHRBackend } from 'angular2/http';
55

6+
import { ROUTER_PROVIDERS } from 'angular2/router';
7+
68
import { LocationStrategy,
7-
HashLocationStrategy,
8-
ROUTER_PROVIDERS } from 'angular2/router';
9+
HashLocationStrategy } from 'angular2/platform/common';
910

1011
import { HeroData } from './hero-data';
1112
import { InMemoryBackendService,

public/docs/_examples/cb-ts-to-js/ts/app/main.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ import {provide}
33
from 'angular2/core';
44
import {bootstrap}
55
from 'angular2/platform/browser';
6+
import {
7+
} from 'angular2/router';
68
import {
79
LocationStrategy,
810
HashLocationStrategy
9-
} from 'angular2/router';
11+
} from 'angular2/platform/common';
1012
// #enddocregion ng2import
1113

1214
// #docregion appimport

public/docs/_examples/dependency-injection/ts/app/car/car-injector.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
// #docplaster
22
//#docregion
3-
import { Injector } from 'angular2/core';
3+
import { ReflectiveInjector } from 'angular2/core';
44

55
import {Car, Engine, Tires} from './car';
66
import {Logger} from '../logger.service';
77

88
//#docregion injector
99
export function useInjector() {
10-
var injector:Injector;
10+
var injector:ReflectiveInjector;
1111

1212
//#enddocregion injector
1313
/*
1414
//#docregion injector-no-new
15-
// Cannot 'new' an Injector like this!
16-
var injector = new Injector([Car, Engine, Tires, Logger]);
15+
// Cannot 'new' an ReflectiveInjector like this!
16+
var injector = new ReflectiveInjector([Car, Engine, Tires, Logger]);
1717
//#enddocregion injector-no-new
1818
*/
1919

2020
//#docregion injector
2121
//#docregion injector-create-and-call
22-
injector = Injector.resolveAndCreate([Car, Engine, Tires, Logger]);
22+
injector = ReflectiveInjector.resolveAndCreate([Car, Engine, Tires, Logger]);
2323
//#docregion injector-call
2424
var car = injector.get(Car);
2525
//#enddocregion injector-call

public/docs/_examples/dependency-injection/ts/app/injector.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class InjectorComponent {
3030
hero = this.heroService.getHeroes()[0];
3131

3232
get rodent() {
33-
let rous = this._injector.getOptional(ROUS);
33+
let rous = this._injector.get(ROUS, null);
3434
if (rous) {
3535
throw new Error('Aaaargh!')
3636
}

public/docs/_examples/homepage-hello-world/ts/index.1.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
<script src="https://code.angularjs.org/tools/system.js"></script>
1616
<script src="https://code.angularjs.org/tools/typescript.js"></script>
17-
<script src="https://code.angularjs.org/2.0.0-beta.15/angular2-polyfills.js"></script>
18-
<script src="https://code.angularjs.org/2.0.0-beta.15/Rx.js"></script>
19-
<script src="https://code.angularjs.org/2.0.0-beta.15/angular2.dev.js"></script>
17+
<script src="https://code.angularjs.org/2.0.0-beta.16/angular2-polyfills.js"></script>
18+
<script src="https://code.angularjs.org/2.0.0-beta.16/Rx.js"></script>
19+
<script src="https://code.angularjs.org/2.0.0-beta.16/angular2.dev.js"></script>
2020

2121
<!-- 2. Configure SystemJS -->
2222
<script>

public/docs/_examples/homepage-tabs/ts/index.1.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515

1616
<script src="https://code.angularjs.org/tools/system.js"></script>
1717
<script src="https://code.angularjs.org/tools/typescript.js"></script>
18-
<script src="https://code.angularjs.org/2.0.0-beta.15/angular2-polyfills.js"></script>
19-
<script src="https://code.angularjs.org/2.0.0-beta.15/Rx.js"></script>
20-
<script src="https://code.angularjs.org/2.0.0-beta.15/angular2.dev.js"></script>
18+
<script src="https://code.angularjs.org/2.0.0-beta.16/angular2-polyfills.js"></script>
19+
<script src="https://code.angularjs.org/2.0.0-beta.16/Rx.js"></script>
20+
<script src="https://code.angularjs.org/2.0.0-beta.16/angular2.dev.js"></script>
2121

2222
<!-- 2. Configure SystemJS -->
2323
<script>

public/docs/_examples/homepage-todo/ts/index.1.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515

1616
<script src="https://code.angularjs.org/tools/system.js"></script>
1717
<script src="https://code.angularjs.org/tools/typescript.js"></script>
18-
<script src="https://code.angularjs.org/2.0.0-beta.15/angular2-polyfills.js"></script>
19-
<script src="https://code.angularjs.org/2.0.0-beta.15/Rx.js"></script>
20-
<script src="https://code.angularjs.org/2.0.0-beta.15/angular2.dev.js"></script>
18+
<script src="https://code.angularjs.org/2.0.0-beta.16/angular2-polyfills.js"></script>
19+
<script src="https://code.angularjs.org/2.0.0-beta.16/Rx.js"></script>
20+
<script src="https://code.angularjs.org/2.0.0-beta.16/angular2.dev.js"></script>
2121

2222
<!-- 2. Configure SystemJS -->
2323
<script>

public/docs/_examples/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,33 +19,33 @@
1919
"author": "",
2020
"license": "ISC",
2121
"dependencies": {
22-
"angular2": "2.0.0-beta.15",
22+
"angular2": "2.0.0-beta.16",
2323
"systemjs": "0.19.26",
2424
"es6-shim": "^0.35.0",
2525
"reflect-metadata": "0.1.2",
2626
"rxjs": "5.0.0-beta.2",
27-
"zone.js": "0.6.10",
27+
"zone.js": "^0.6.12",
2828

29-
"a2-in-memory-web-api": "^0.1.15",
29+
"a2-in-memory-web-api": "^0.1.16",
3030
"bootstrap": "^3.3.6"
31-
3231
},
3332
"devDependencies": {
3433
"concurrently": "^2.0.0",
3534
"lite-server": "^2.2.0",
3635
"typescript": "^1.8.10",
37-
"typings":"^0.7.12",
36+
"typings": "^0.8.1",
3837

3938
"canonical-path": "0.0.2",
4039
"http-server": "^0.9.0",
40+
"lodash": "^4.11.1",
4141
"jasmine-core": "~2.4.1",
4242
"karma": "^0.13.22",
4343
"karma-chrome-launcher": "^0.2.3",
4444
"karma-cli": "^0.1.2",
4545
"karma-htmlfile-reporter": "^0.2.2",
4646
"karma-jasmine": "^0.3.8",
47-
"protractor": "^3.2.2",
47+
"protractor": "^3.3.0",
4848
"rimraf": "^2.5.2"
4949
},
50-
"repository": { }
50+
"repository": {}
5151
}

public/docs/_examples/pipes/ts/app/app.component.html

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ <h1>Pipes</h1>
1010
<a href="#flying-heroes-impure">Flying Heroes filter pipe (impure)</a><br>
1111
<a href="#hero-message">Async Hero Message and AsyncPipe</a><br>
1212
<a href="#hero-list">Hero List with caching FetchJsonPipe</a><br>
13-
<a href="#random-pipe">Random Pipe (pure pipe / impure function)</a><br>
1413

1514

1615
<hr>
@@ -81,8 +80,4 @@ <h2>Birthday Pipe Chaining</h2>
8180
<a id="hero-list"></a>
8281
<hero-list></hero-list>
8382

84-
<hr>
85-
<a id="random-pipe"></a>
86-
<random-pipe></random-pipe>
87-
8883
<div style="margin-top:12em;"></div>

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {HeroBirthday2} from './hero-birthday2.component';
1010
import {HeroListComponent} from './hero-list.component';
1111
import {PowerBooster} from './power-booster.component';
1212
import {PowerBoostCalculator} from './power-boost-calculator.component';
13-
import {RandomPipeComponent} from './random-pipe.component';
1413

1514
@Component({
1615
selector: 'my-app',
@@ -21,8 +20,7 @@ import {RandomPipeComponent} from './random-pipe.component';
2120
HeroBirthday,
2221
HeroBirthday2,
2322
HeroListComponent,
24-
PowerBooster, PowerBoostCalculator,
25-
RandomPipeComponent
23+
PowerBooster, PowerBoostCalculator
2624
],
2725
providers:[HTTP_PROVIDERS]
2826
})

public/docs/_examples/pipes/ts/app/exponential-strength.pipe.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import {Pipe, PipeTransform} from 'angular2/core';
1111
*/
1212
@Pipe({name: 'exponentialStrength'})
1313
export class ExponentialStrengthPipe implements PipeTransform {
14-
transform(value:number, [exponent]) : number {
15-
var exp = parseFloat(exponent);
14+
transform(value: number, exponent: string): number {
15+
let exp = parseFloat(exponent);
1616
return Math.pow(value, isNaN(exp) ? 1 : exp);
1717
}
1818
}

public/docs/_examples/pipes/ts/app/fetch-json.pipe.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ export class FetchJsonPipe implements PipeTransform{
1414

1515
constructor(private _http: Http) { }
1616

17-
transform(url:string):any {
17+
transform(url: string): any {
1818
if (url !== this.prevUrl) {
1919
this.prevUrl = url;
2020
this.fetched = null;
2121
this._http.get(url)
2222
.map( result => result.json() )
23-
.subscribe( result => this.fetched = result )
23+
.subscribe( result => this.fetched = result );
2424
}
2525

2626
return this.fetched;

public/docs/_examples/pipes/ts/app/random-pipe.component.ts

Lines changed: 0 additions & 24 deletions
This file was deleted.

public/docs/_examples/quickstart/js/package.1.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
},
88
"license": "ISC",
99
"dependencies": {
10-
"angular2": "2.0.0-beta.15",
10+
"angular2": "2.0.0-beta.16",
1111
"es6-shim": "^0.35.0",
1212
"reflect-metadata": "0.1.2",
1313
"rxjs": "5.0.0-beta.2",
14-
"zone.js": "0.6.10"
14+
"zone.js": "0.6.12"
1515
},
1616
"devDependencies": {
1717
"concurrently": "^2.0.0",

public/docs/_examples/quickstart/ts/package.1.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111
},
1212
"license": "ISC",
1313
"dependencies": {
14-
"angular2": "2.0.0-beta.15",
14+
"angular2": "2.0.0-beta.16",
1515
"systemjs": "0.19.26",
1616
"es6-shim": "^0.35.0",
1717
"reflect-metadata": "0.1.2",
1818
"rxjs": "5.0.0-beta.2",
19-
"zone.js": "0.6.10"
19+
"zone.js": "0.6.12"
2020
},
2121
"devDependencies": {
2222
"concurrently": "^2.0.0",
2323
"lite-server": "^2.2.0",
2424
"typescript": "^1.8.10",
25-
"typings":"^0.7.12"
25+
"typings":"^0.8.1"
2626
}
2727
}

public/docs/_examples/router/ts/app/main.2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {AppComponent} from './app.component';
1111
// Add these symbols to override the `LocationStrategy`
1212
import {provide} from 'angular2/core';
1313
import {LocationStrategy,
14-
HashLocationStrategy} from 'angular2/router';
14+
HashLocationStrategy} from 'angular2/platform/common';
1515
// #enddocregion
1616
/* Can't use AppComponent ... but display as if we can
1717
// #docregion
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// #docregion
2+
import { Component } from 'angular2/core';
3+
4+
// #docregion example
5+
@Component({
6+
selector: 'toh-hero'
7+
})
8+
export class HeroComponent {}
9+
// #enddocregion example
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// #docregion
2+
/**
3+
* AVOID THIS PATTERN
4+
*/
5+
6+
/*
7+
* HeroComponent is in the Tour of Heroes feature
8+
*/
9+
@Component({
10+
selector: 'hero'
11+
})
12+
export class HeroComponent {}
13+
14+
/*
15+
* UsersComponent is in an Admin feature
16+
*/
17+
@Component({
18+
selector: 'users'
19+
})
20+
export class UsersComponent {}

0 commit comments

Comments
 (0)