Skip to content

Commit 93e8fef

Browse files
committed
Upgrade to RC1: router -> router-deprecated
1 parent 48654ed commit 93e8fef

File tree

19 files changed

+254
-257
lines changed

19 files changed

+254
-257
lines changed

ng-sample/app/app.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ import {ModalTest} from "./examples/modal/modal-test";
2727
import {PlatfromDirectivesTest} from "./examples/platform-directives/platform-directives-test";
2828
import {RouterOutletTest} from "./examples/navigation/router-outlet-test";
2929

30-
nativeScriptBootstrap(RendererTest).then((compRef) => {
31-
console.log("nativeScriptBootstrap resloved: " + compRef);
32-
}).catch((e) => {
33-
console.log("nativeScriptBootstrap error: " + e);
34-
});
30+
nativeScriptBootstrap(RendererTest);
3531
//nativeScriptBootstrap(Benchmark);
3632
//nativeScriptBootstrap(ListTest);
3733
//nativeScriptBootstrap(ListTestAsync);

ng-sample/app/examples/action-bar/action-bar-test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Component} from '@angular/core';
2-
import {RouteConfig} from '@angular/router';
2+
import {RouteConfig} from '@angular/router-deprecated';
33
import { Page} from "ui/page";
44
import {NS_ROUTER_DIRECTIVES, NS_ROUTER_PROVIDERS} from "../../nativescript-angular/router/ns-router";
55
import {NS_DIRECTIVES} from "../../nativescript-angular/directives";

ng-sample/app/examples/navigation/nav-component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {Component} from '@angular/core';
22
import {ROUTER_DIRECTIVES, Router, OnActivate, OnDeactivate, CanReuse, OnReuse,
3-
RouteParams, ComponentInstruction, RouteConfig } from '@angular/router';
3+
RouteParams, ComponentInstruction, RouteConfig } from '@angular/router-deprecated';
44
import {Location, LocationStrategy} from '@angular/common';
55
import {topmost} from "ui/frame";
66
import {Page} from "ui/page";

ng-sample/app/examples/navigation/navigation-test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Component} from '@angular/core';
2-
import {RouteConfig, ROUTER_PROVIDERS, ROUTER_DIRECTIVES, ComponentInstruction} from '@angular/router';
2+
import {RouteConfig, ROUTER_PROVIDERS, ROUTER_DIRECTIVES, ComponentInstruction} from '@angular/router-deprecated';
33

44
import {NavComponent} from "./nav-component";
55
import {NS_ROUTER_DIRECTIVES, NS_ROUTER_PROVIDERS} from "../../nativescript-angular/router/ns-router";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Component} from '@angular/core';
2-
import {RouteConfig, ROUTER_PROVIDERS, ROUTER_DIRECTIVES, ComponentInstruction, RouteParams} from '@angular/router';
2+
import {RouteConfig, ROUTER_PROVIDERS, ROUTER_DIRECTIVES, ComponentInstruction, RouteParams} from '@angular/router-deprecated';
33
import {NS_ROUTER_DIRECTIVES, NS_ROUTER_PROVIDERS} from "../../nativescript-angular/router/ns-router";
44

55
@Component({

ng-sample/package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,25 @@
2525
"dependencies": {
2626
"tns-core-modules": "^2.0.0",
2727
"nativescript-intl": "^0.0.2",
28-
"@angular/common": "0.0.0-0",
29-
"@angular/compiler": "0.0.0-0",
30-
"@angular/core": "0.0.0-0",
31-
"@angular/router": "0.0.0-0",
32-
"@angular/platform-browser": "0.0.0-0",
33-
"@angular/platform-browser-dynamic": "0.0.0-0",
34-
"@angular/platform-server": "0.0.0-0",
28+
"@angular/common": "2.0.0-rc.1",
29+
"@angular/compiler": "2.0.0-rc.1",
30+
"@angular/core": "2.0.0-rc.1",
31+
"@angular/router-deprecated": "2.0.0-rc.1",
32+
"@angular/platform-browser": "2.0.0-rc.1",
33+
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
34+
"@angular/platform-server": "2.0.0-rc.1",
3535
"reflect-metadata": "^0.1.3",
36-
"rxjs": "5.0.0-beta.2",
36+
"rxjs": "5.0.0-beta.6",
3737
"zone.js": "^0.6.12",
3838
"parse5": "1.4.2",
3939
"punycode": "1.3.2",
4040
"querystring": "0.2.0",
4141
"url": "0.10.3"
4242
},
4343
"devDependencies": {
44-
"babel-traverse": "6.7.6",
45-
"babel-types": "6.7.7",
46-
"babylon": "6.7.0",
44+
"babel-traverse": "6.8.0",
45+
"babel-types": "6.8.1",
46+
"babylon": "6.8.0",
4747
"filewalker": "0.1.2",
4848
"grunt": "0.4.5",
4949
"grunt-contrib-clean": "0.6.0",

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
"dependencies": {
1717
"tns-core-modules": "^2.0.0",
1818
"nativescript-intl": "^0.0.2",
19-
"@angular/common": "0.0.0-0",
20-
"@angular/compiler": "0.0.0-0",
21-
"@angular/core": "0.0.0-0",
22-
"@angular/router": "0.0.0-0",
23-
"@angular/platform-browser": "0.0.0-0",
24-
"@angular/platform-browser-dynamic": "0.0.0-0",
25-
"@angular/platform-server": "0.0.0-0",
19+
"@angular/common": "2.0.0-rc.1",
20+
"@angular/compiler": "2.0.0-rc.1",
21+
"@angular/core": "2.0.0-rc.1",
22+
"@angular/router-deprecated": "2.0.0-rc.1",
23+
"@angular/platform-browser": "2.0.0-rc.1",
24+
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
25+
"@angular/platform-server": "2.0.0-rc.1",
2626
"reflect-metadata": "^0.1.3",
27-
"rxjs": "5.0.0-beta.2",
27+
"rxjs": "5.0.0-beta.6",
2828
"zone.js": "^0.6.12",
2929
"parse5": "1.4.2",
3030
"punycode": "1.3.2",
@@ -40,7 +40,7 @@
4040
"grunt-env": "0.4.4",
4141
"grunt-ts": "5.0.0-beta.5",
4242
"shelljs": "^0.5.3",
43-
"typescript": "1.8.2"
43+
"typescript": "^1.8.10"
4444
},
4545
"peerDependencies": {
4646
"tns-core-modules": ">=2.0.0 || >=2.0.0-2016 || >=2.0.0-angular-4"

src/nativescript-angular/common/detached-loader.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import {DynamicComponentLoader, ComponentRef, ViewContainerRef, Component, Type, ViewChild} from '@angular/core';
22

3+
type AnyComponentRef = ComponentRef<any>;
34
interface PendingLoadEntry {
45
componentType: Type;
5-
resolveCallback: (ComponentRef) => void;
6+
resolveCallback: (AnyComponentRef) => void;
67
}
78

89
/**
@@ -34,11 +35,11 @@ export class DetachedLoader {
3435
});
3536
}
3637

37-
private loadInLocation(componentType: Type): Promise<ComponentRef> {
38+
private loadInLocation(componentType: Type): Promise<ComponentRef<any>> {
3839
return this.loader.loadNextToLocation(componentType, this.containerRef);
3940
}
4041

41-
public loadComponent(componentType: Type): Promise<ComponentRef> {
42+
public loadComponent(componentType: Type): Promise<ComponentRef<any>> {
4243
// Check if called before placeholder is initialized.
4344
// Delay load if so.
4445
if (this.viewLoaded) {

src/nativescript-angular/directives/dialogs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class ModalDialogService {
3535
return new Promise((resove, reject) => {
3636
const page = new Page();
3737

38-
var detachedLoaderRef: ComponentRef;
38+
var detachedLoaderRef: ComponentRef<DetachedLoader>;
3939
const closeCallback = (...args) => {
4040
resove.apply(undefined, args);
4141
page.closeModal();

src/nativescript-angular/directives/tab-view.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class TabViewItemDirective {
3939

4040
constructor(
4141
private owner: TabViewDirective,
42-
private templateRef: TemplateRef,
42+
private templateRef: TemplateRef<any>,
4343
private viewContainer: ViewContainerRef
4444
) {
4545
}

src/nativescript-angular/router/ns-router-link.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {Directive, Input} from '@angular/core';
22
import {isString} from '@angular/core/src/facade/lang';
3-
import {Router, Instruction} from '@angular/router';
3+
import {Router, Instruction} from '@angular/router-deprecated';
44
import {Location} from '@angular/common';
55
import { log } from "./common";
66

src/nativescript-angular/router/ns-router.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {Type} from '@angular/core/src/facade/lang';
22
import {NSRouterLink} from './ns-router-link';
33
import {PageRouterOutlet} from './page-router-outlet';
44
import {NSLocationStrategy} from './ns-location-strategy';
5-
import {ROUTER_PROVIDERS} from '@angular/router';
5+
import {ROUTER_PROVIDERS} from '@angular/router-deprecated';
66
import {LocationStrategy} from '@angular/common';
77
import {provide} from '@angular/core';
88
import { CATEGORY } from "./common";

src/nativescript-angular/router/page-router-outlet.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import {
99
Component, Inject
1010
} from '@angular/core';
1111

12-
import * as routerHooks from '@angular/router/src/lifecycle/lifecycle_annotations';
13-
import {hasLifecycleHook} from '@angular/router/src/lifecycle/route_lifecycle_reflector';
12+
import * as routerHooks from '@angular/router-deprecated/src/lifecycle/lifecycle_annotations';
13+
import {hasLifecycleHook} from '@angular/router-deprecated/src/lifecycle/route_lifecycle_reflector';
1414

1515
import {Router, RouterOutlet, RouteData, RouteParams, ComponentInstruction,
16-
OnActivate, OnDeactivate, OnReuse, CanReuse} from '@angular/router';
16+
OnActivate, OnDeactivate, OnReuse, CanReuse} from '@angular/router-deprecated';
1717
import {LocationStrategy} from '@angular/common';
1818
import {topmost} from "ui/frame";
1919
import {Page, NavigatedData} from "ui/page";
@@ -27,8 +27,8 @@ import {ViewUtil} from "../view-util";
2727
let _resolveToTrue = PromiseWrapper.resolve(true);
2828

2929
interface CacheItem {
30-
componentRef: ComponentRef;
31-
loaderRef?: ComponentRef;
30+
componentRef: ComponentRef<any>;
31+
loaderRef?: ComponentRef<any>;
3232
router: Router;
3333
}
3434

@@ -38,7 +38,7 @@ interface CacheItem {
3838
class RefCache {
3939
private cache: Array<CacheItem> = new Array<CacheItem>();
4040

41-
public push(comp: ComponentRef, router: Router, loaderRef?: ComponentRef) {
41+
public push(comp: ComponentRef<any>, router: Router, loaderRef?: ComponentRef<any>) {
4242
this.cache.push({ componentRef: comp, router: router, loaderRef: loaderRef });
4343
}
4444

@@ -71,7 +71,7 @@ export class PageRouterOutlet extends RouterOutlet {
7171
private isInitalPage: boolean = true;
7272
private refCache: RefCache = new RefCache();
7373

74-
private componentRef: ComponentRef = null;
74+
private componentRef: ComponentRef<any> = null;
7575
private currentInstruction: ComponentInstruction = null;
7676
private viewUtil: ViewUtil;
7777
@ViewChild('loader', { read: ViewContainerRef }) childContainerRef: ViewContainerRef;
@@ -123,7 +123,7 @@ export class PageRouterOutlet extends RouterOutlet {
123123
private activateOnGoForward(nextInstruction: ComponentInstruction, previousInstruction: ComponentInstruction): Promise<any> {
124124
let componentType = nextInstruction.componentType;
125125
let resultPromise: Promise<any>;
126-
let loaderRef: ComponentRef = undefined;
126+
let loaderRef: ComponentRef<any> = undefined;
127127
const childRouter = this.parentRouter.childRouter(componentType);
128128

129129
const providersArray = [
@@ -163,7 +163,7 @@ export class PageRouterOutlet extends RouterOutlet {
163163
}
164164

165165

166-
private loadComponentInPage(page: Page, componentRef: ComponentRef): Promise<ComponentRef> {
166+
private loadComponentInPage(page: Page, componentRef: ComponentRef<any>): Promise<ComponentRef<any>> {
167167
//Component loaded. Find its root native view.
168168
const componentView = componentRef.location.nativeElement;
169169
//Remove it from original native parent.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<!-- >> icon-font-sample -->
22
<GridLayout>
33
<ListView [items]="glyphs">
4-
<template #item="item">
4+
<template let-item="item">
55
<StackLayout orientation="horizontal">
66
<Label [text]="item.icon" class="icon"></Label>
77
<Label [text]="item.code"></Label>
88
</StackLayout>
99
</template>
1010
</ListView>
1111
</GridLayout>
12-
<!-- << icon-font-sample -->
12+
<!-- << icon-font-sample -->

0 commit comments

Comments
 (0)