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

Commit b8e62a0

Browse files
filipesilvawardbell
authored andcommitted
chore(ts): updating to beta.16
1 parent 3bc9414 commit b8e62a0

File tree

20 files changed

+57
-98
lines changed

20 files changed

+57
-98
lines changed

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: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,21 @@
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",
@@ -44,8 +43,8 @@
4443
"karma-cli": "^0.1.2",
4544
"karma-htmlfile-reporter": "^0.2.2",
4645
"karma-jasmine": "^0.3.8",
47-
"protractor": "^3.2.2",
46+
"protractor": "^3.3.0",
4847
"rimraf": "^2.5.2"
4948
},
50-
"repository": { }
49+
"repository": {}
5150
}

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

public/docs/_examples/testing/ts/app/mock-router.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export * from 'angular2/router';
22

3-
import { Directive, DynamicComponentLoader, ElementRef,
3+
import { Directive, DynamicComponentLoader, ViewContainerRef,
44
Injectable, Optional, Input } from 'angular2/core';
55

66
import { PromiseWrapper } from 'angular2/src/facade/promise';
@@ -52,11 +52,11 @@ export class MockRouterOutlet extends RouterOutlet {
5252
name: string = null;
5353

5454
constructor(
55-
_elementRef: ElementRef,
55+
_viewContainerRef: ViewContainerRef,
5656
@Optional() _loader: DynamicComponentLoader,
5757
_parentRouter: Router,
5858
nameAttr: string) {
59-
super(_elementRef, _loader, _parentRouter, nameAttr);
59+
super(_viewContainerRef, _loader, _parentRouter, nameAttr);
6060
if (nameAttr) {
6161
this.name = nameAttr;
6262
}

public/docs/ts/latest/guide/dependency-injection.jade

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,8 @@ p.
871871
They are retrieved by calling `injector.get`.
872872

873873
The `get` method throws an error if it can't resolve the requested service.
874-
We can call `getOptional` instead, which we do in one case
874+
We can call `get` with a second parameter (the value to return if the service is not found)
875+
instead, which we do in one case
875876
to retrieve a service (`ROUS`) that isn't registered with this or any ancestor injector.
876877

877878
.l-sub-section

public/docs/ts/latest/guide/pipes.jade

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -386,33 +386,21 @@ figure.image-display
386386

387387
a(id="pure-pipe-pure-fn")
388388
:marked
389-
### Pure pipes vs. pure functions
389+
### Pure pipes and pure functions
390390

391-
When developers first hear of *pure pipes* many of them think these pipes must be *pure functions*.
391+
A pure pipe uses pure functions.
392392

393393
Pure functions process inputs and return values without detectable side-effects.
394394
Given the same input they should always return the same output.
395395

396-
Pure pipes _are_ typically implemented with pure function.
397396
The pipes we saw earlier in this chapter were implemented with pure functions.
398397
The built-in `DatePipe` is a pure pipe with a pure function implementation.
399398
So is our `ExponentialStrengthPipe`.
400399
So is our `FlyingHeroesPipe`.
401400

402-
But there is no necessary connection between a pure pipe and a pure function.
403401
A few steps back we reviewed the `FlyingHeroesImpurePipe` &mdash; *an impure pipe with a pure function*.
404-
405-
We can also write *a pure pipe with an impure function* such as the
406-
`RandomizerPipe` (also in the [live example](/resources/live-examples/pipes/ts/plnkr.html))
407-
that ignores its input value and outputs a random number. Clearly an impure function!
408-
Yet it's perfectly well behaved as a pure pipe.
409-
+makeExample('pipes/ts/app/random-pipe.component.ts', 'pipe','app/random-pipe.component.ts (pipe)')(format='.')
410-
:marked
411-
When the input changes, it outputs a new value albeit never the same value for the same input.
412-
413-
Remember *purity in a pipe has nothing to do with pure functions!*
414-
415-
*Pipe purity* is more about the purity of the input values than of the pipe itself.
402+
403+
But a *pure pipe* must always be implemented with a *pure function*. Failure to heed this warning will bring about many a console errors regarding expressions that have changed after they were checked.
416404

417405
.l-main-section
418406
:marked
@@ -471,4 +459,3 @@ code-example(format="." language="html")
471459

472460
If these performance and minification considerations do not apply to you, you can always create your own such pipes
473461
(along the lines of the [FlyingHeroesPipe](#impure-flying-heroes)) or find them in the community.
474-

0 commit comments

Comments
 (0)