Skip to content

Commit b157b0b

Browse files
author
vakrilov
committed
Update to 2.3.1
1 parent 6cfb88e commit b157b0b

19 files changed

+146
-143
lines changed

nativescript-angular/package.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222
},
2323
"dependencies": {
2424
"nativescript-intl": "~0.0.8",
25-
"@angular/core": "~2.2.1",
26-
"@angular/common": "~2.2.1",
27-
"@angular/compiler": "~2.2.1",
28-
"@angular/http": "~2.2.1",
29-
"@angular/platform-browser": "~2.2.1",
30-
"@angular/platform-browser-dynamic": "~2.2.1",
31-
"@angular/forms": "~2.2.1",
32-
"@angular/router": "~3.2.1",
33-
"rxjs": "5.0.0-beta.12",
25+
"@angular/core": "~2.3.1",
26+
"@angular/common": "~2.3.1",
27+
"@angular/compiler": "~2.3.1",
28+
"@angular/http": "~2.3.1",
29+
"@angular/platform-browser": "~2.3.1",
30+
"@angular/platform-browser-dynamic": "~2.3.1",
31+
"@angular/forms": "~2.3.1",
32+
"@angular/router": "~3.3.1",
33+
"rxjs": "5.0.0-rc.4",
3434
"reflect-metadata": "~0.1.8",
3535
"parse5": "1.3.2",
3636
"punycode": "1.3.2",
@@ -41,10 +41,10 @@
4141
"typescript": "~2.0.10",
4242
"tslint": "~4.0.1",
4343
"codelyzer": "^2.0.0-beta.1",
44-
"@angular/compiler-cli": "~2.2.1",
44+
"@angular/compiler-cli": "~2.3.1",
4545
"codelyzer": "^2.0.0-beta.1",
4646
"tns-core-modules": ">=2.5.0 || >=2.5.0-2016",
47-
"zone.js": "^0.6.21"
47+
"zone.js": "^0.7.2"
4848
},
4949
"nativescript": {}
5050
}

nativescript-angular/router/ns-location-strategy.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class NSLocationStrategy extends LocationStrategy {
2828
private states = new Array<LocationState>();
2929
private popStateCallbacks = new Array<(_: any) => any>();
3030

31-
private _isPageNavigationgBack = false;
31+
private _isPageNavigationBack = false;
3232
private _currentNavigationOptions: NavigationOptions;
3333

3434
constructor(private frame: Frame) {
@@ -86,7 +86,7 @@ export class NSLocationStrategy extends LocationStrategy {
8686
}
8787

8888
back(): void {
89-
if (this._isPageNavigationgBack) {
89+
if (this._isPageNavigationBack) {
9090
// We are navigating to the previous page
9191
// clear the stack until we get to a page navigation state
9292
let state = this.states.pop();
@@ -154,22 +154,22 @@ export class NSLocationStrategy extends LocationStrategy {
154154
// Methods for syncing with page navigation in PageRouterOutlet
155155
public _beginBackPageNavigation() {
156156
routerLog("NSLocationStrategy.startGoBack()");
157-
if (this._isPageNavigationgBack) {
157+
if (this._isPageNavigationBack) {
158158
throw new Error("Calling startGoBack while going back.");
159159
}
160-
this._isPageNavigationgBack = true;
160+
this._isPageNavigationBack = true;
161161
}
162162

163163
public _finishBackPageNavigation() {
164164
routerLog("NSLocationStrategy.finishBackPageNavigation()");
165-
if (!this._isPageNavigationgBack) {
165+
if (!this._isPageNavigationBack) {
166166
throw new Error("Calling endGoBack while not going back.");
167167
}
168-
this._isPageNavigationgBack = false;
168+
this._isPageNavigationBack = false;
169169
}
170170

171171
public _isPageNavigatingBack() {
172-
return this._isPageNavigationgBack;
172+
return this._isPageNavigationBack;
173173
}
174174

175175
public _beginPageNavigation(): NavigationOptions {
@@ -199,7 +199,7 @@ export class NSLocationStrategy extends LocationStrategy {
199199
`${JSON.stringify(this._currentNavigationOptions)})`);
200200
}
201201

202-
public _getSatates(): Array<LocationState> {
202+
public _getStates(): Array<LocationState> {
203203
return this.states.slice();
204204
}
205205
}

ng-sample/app/examples/list/list-test-async.ts

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Component, Input, ChangeDetectionStrategy } from '@angular/core';
2-
import * as Rx from 'rxjs/Observable';
3-
import { combineLatest } from 'rxjs/operator/combineLatest';
1+
import { Component, ChangeDetectionStrategy } from '@angular/core';
2+
import { DataItem, DataService } from "./data.service";
3+
import { Observable } from "rxjs/Observable";
44
import { BehaviorSubject } from "rxjs/BehaviorSubject";
5-
import { DataItem, DataService } from "./data.service"
5+
import "rxjs/add/operator/combineLatest";
66

77
@Component({
88
selector: 'list-test-async',
@@ -80,19 +80,18 @@ export class ListTestAsync {
8080
8181
<StackLayout row="2" colSpan="2" orientation="horizontal">
8282
<button (tap)="toggleAsyncUpdates()" [text]="isUpdating ? 'stop updates' : 'start updates'"></button>
83-
<button (tap)="toogleFilter()" [text]="(filter$ | async) ? 'show all' : 'show even'"></button>
83+
<button (tap)="toggleFilter()" [text]="(filter$ | async) ? 'show all' : 'show even'"></button>
8484
</StackLayout>
8585
</GridLayout>
8686
`
8787
})
8888
export class ListTestFilterAsync {
8989
public isUpdating: boolean = false;
90-
public filteredItems$: Rx.Observable<Array<DataItem>>;
90+
public filteredItems$: Observable<Array<DataItem>>;
9191
private filter$ = new BehaviorSubject(false);
9292

9393
constructor(private service: DataService) {
94-
// Create filteredItems$ by combining the service.items$ and filter$
95-
this.filteredItems$ = combineLatest(this.service.items$, this.filter$, (data, filter) => {
94+
this.filteredItems$ = this.service.items$.combineLatest(this.filter$, (data, filter) => {
9695
return filter ? data.filter(v => v.id % 2 === 0) : data;
9796
});
9897
}
@@ -111,7 +110,7 @@ export class ListTestFilterAsync {
111110
this.isUpdating = !this.isUpdating;
112111
}
113112

114-
public toogleFilter() {
113+
public toggleFilter() {
115114
this.filter$.next(!this.filter$.value);
116115
}
117116
}

ng-sample/app/examples/router/clear-history-test.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import { Component, OnInit, OnDestroy, Injectable } from "@angular/core";
2-
import { ActivatedRoute, Router, CanDeactivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
3-
import { Observable } from "rxjs";
4-
import { RouterExtensions, PageRoute } from "nativescript-angular/router";
2+
import { Router } from '@angular/router';
3+
import { RouterExtensions } from "nativescript-angular/router";
54
import { NSLocationStrategy } from "nativescript-angular/router/ns-location-strategy";
6-
import { BehaviorSubject} from "rxjs";
5+
import { BehaviorSubject } from "rxjs/BehaviorSubject";
76

87
@Injectable()
98
class LocationLogService {
@@ -15,7 +14,7 @@ class LocationLogService {
1514
router.events.subscribe((e) => {
1615
this.routerEvents$.next([...this.routerEvents$.getValue(), e.toString()]);
1716

18-
let states = this.strategy._getSatates()
17+
let states = this.strategy._getStates()
1918
.map((v, i) => {
2019
return (i + "." + (v.isPageNavigation ? "[PAGE]" : "") + " \"" + v.url + "\"");
2120
})

ng-sample/app/examples/router/login-test.ts

+10-11
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import { Component, OnInit, OnDestroy, Injectable } from "@angular/core";
2-
import { Router, CanActivate, Resolve, ActivatedRouteSnapshot, RouterStateSnapshot, ActivatedRoute, Params } from '@angular/router';
3-
import { Observable } from "rxjs";
1+
import { Component, Injectable } from "@angular/core";
2+
import { CanActivate, Resolve, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
43
import { RouterExtensions, PageRoute } from "nativescript-angular/router";
5-
import { NSLocationStrategy } from "nativescript-angular/router/ns-location-strategy";
6-
import { BehaviorSubject } from "rxjs";
7-
import { Page } from "ui/page";
8-
import * as appSettings from "application-settings"
4+
import * as appSettings from "application-settings";
5+
import { Observable } from "rxjs/Observable";
6+
import "rxjs/add/operator/map";
7+
import "rxjs/add/operator/switchMap";
98

109
const USER_KEY = "user";
1110

@@ -160,7 +159,7 @@ class ResolveGuard implements Resolve<ResolvedData> {
160159
static counter = 0;
161160
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<ResolvedData> | Promise<ResolvedData> | ResolvedData {
162161
const result: ResolvedData = { id: ResolveGuard.counter++ }
163-
console.log(`ResolveGuard: Fteching new data. Result: ${JSON.stringify(result)} `);
162+
console.log(`ResolveGuard: Fetching new data. Result: ${JSON.stringify(result)} `);
164163
return result;
165164
}
166165
}
@@ -175,17 +174,17 @@ export class LoginAppComponent {
175174
{ path: "main", component: MainComponent, canActivate: [AuthGuard], resolve: [ResolveGuard] },
176175
{ path: "inner", component: InnerComponent, canActivate: [AuthGuard] },
177176
{ path: "login", component: LoginComponent },
178-
]
177+
];
179178

180179
static entries = [
181180
LoginComponent,
182181
MainComponent,
183182
InnerComponent
184-
]
183+
];
185184

186185
static providers = [
187186
AuthGuard,
188187
ResolveGuard,
189188
LoginService,
190-
]
189+
];
191190
}

ng-sample/app/examples/router/page-router-outlet-nested-test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { Component, OnInit, OnDestroy } from "@angular/core";
2-
import { ActivatedRoute, Router, Event } from '@angular/router';
3-
import { Observable } from "rxjs";
4-
import { Location, LocationStrategy} from '@angular/common';
2+
import { ActivatedRoute, Router } from '@angular/router';
3+
import { Location } from '@angular/common';
54
import { Page } from "ui/page";
6-
5+
import { Observable } from "rxjs/Observable";
6+
import 'rxjs/add/operator/map';
77

88
@Component({
99
selector: "first",

ng-sample/app/examples/router/page-router-outlet-test.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { Component, OnInit, OnDestroy } from "@angular/core";
22
import { ActivatedRoute, Router } from '@angular/router';
3-
import { Observable } from "rxjs";
43
import { Location } from '@angular/common';
54
import { Page } from "ui/page";
5+
import { Observable } from "rxjs/Observable";
6+
import 'rxjs/add/operator/map';
67

78

89
@Component({

ng-sample/app/examples/router/router-outlet-test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Component, OnInit, OnDestroy } from "@angular/core";
22
import { ActivatedRoute } from '@angular/router';
3+
import "rxjs/add/operator/map";
34

45
@Component({
56
selector: "first",

ng-sample/package.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,20 @@
2323
},
2424
"homepage": "https://github.com/NativeScript/template-hello-world",
2525
"dependencies": {
26-
"tns-core-modules": "2.4.0",
26+
"tns-core-modules": "~2.4.0",
2727
"nativescript-angular": "file:../nativescript-angular",
28-
"@angular/core": "~2.2.1",
29-
"@angular/common": "~2.2.1",
30-
"@angular/compiler": "~2.2.1",
31-
"@angular/forms": "~2.2.1",
32-
"@angular/http": "~2.2.1",
33-
"@angular/platform-browser": "~2.2.1",
34-
"@angular/platform-browser-dynamic": "~2.2.1",
35-
"@angular/router": "~3.2.1",
36-
"rxjs": "5.0.0-beta.12"
28+
"@angular/core": "~2.3.1",
29+
"@angular/common": "~2.3.1",
30+
"@angular/compiler": "~2.3.1",
31+
"@angular/http": "~2.3.1",
32+
"@angular/platform-browser": "~2.3.1",
33+
"@angular/platform-browser-dynamic": "~2.3.1",
34+
"@angular/forms": "~2.3.1",
35+
"@angular/router": "~3.3.1",
36+
"rxjs": "5.0.0-rc.4"
3737
},
3838
"devDependencies": {
39-
"zone.js": "~0.6.21",
39+
"zone.js": "~0.7.2",
4040
"babel-traverse": "6.9.0",
4141
"babel-types": "6.10.0",
4242
"babylon": "6.8.1",

tests/app/base.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import {Component, OpaqueToken, OnInit, OnDestroy} from "@angular/core";
1+
import { OpaqueToken, OnInit, OnDestroy } from "@angular/core";
22
export const HOOKS_LOG = new OpaqueToken("Hooks log");
3-
import {BehaviorSubject} from "rxjs";
3+
import { BehaviorSubject } from "rxjs/BehaviorSubject";
44

55
export class BaseComponent implements OnInit, OnDestroy {
66
protected name: string = "";

tests/app/first.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Router, ActivatedRoute } from '@angular/router';
22
import { Component, Inject } from "@angular/core";
33
import { HOOKS_LOG, BaseComponent } from "./base.component";
4-
import { BehaviorSubject } from "rxjs";
4+
import { BehaviorSubject } from "rxjs/BehaviorSubject";
55

66
@Component({
77
selector: "first-comp",

tests/app/main.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { NavigationApp } from "./snippets/navigation/router-outlet";
2626

2727
import { rendererTraceCategory, routerTraceCategory } from "nativescript-angular/trace";
2828

29-
import { BehaviorSubject } from "rxjs";
29+
import { BehaviorSubject } from "rxjs/BehaviorSubject";
3030

3131
import trace = require("trace");
3232
// trace.setCategories(rendererTraceCategory + "," + routerTraceCategory);

tests/app/second.component.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import {Router, ActivatedRoute } from '@angular/router';
2-
import {Component, Inject} from "@angular/core";
3-
import {Location} from "@angular/common";
4-
import {HOOKS_LOG, BaseComponent} from "./base.component";
5-
import {BehaviorSubject} from "rxjs";
1+
import { Router, ActivatedRoute } from "@angular/router";
2+
import { Component, Inject } from "@angular/core";
3+
import { Location } from "@angular/common";
4+
import { HOOKS_LOG, BaseComponent } from "./base.component";
5+
import { BehaviorSubject } from "rxjs/BehaviorSubject";
66

77
@Component({
88
selector: "second-comp",
@@ -17,7 +17,7 @@ import {BehaviorSubject} from "rxjs";
1717
})
1818
export class SecondComponent extends BaseComponent {
1919
protected name = "second";
20-
public id: string = ""
20+
public id: string = "";
2121

2222
constructor(private router: Router, private location: Location, private routeData: ActivatedRoute, @Inject(HOOKS_LOG) hooksLog: BehaviorSubject<Array<string>>) {
2323
super(hooksLog);

tests/app/snippets/navigation/route-params.ts

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ class MyComponent {
1212

1313
// >> router-params-page-route
1414
import { PageRoute } from "nativescript-angular/router";
15+
import "rxjs/add/operator/switchMap";
16+
1517
class MyPageComponent {
1618
id: number;
1719
constructor(private pageRoute: PageRoute) {

0 commit comments

Comments
 (0)