Skip to content

Commit 3219406

Browse files
fix(ng2.UIRouter): Update ui-router for ng2 rc.1
Closes #2722
1 parent 45c0758 commit 3219406

10 files changed

+29
-29
lines changed

package.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "ui-router",
33
"description": "State-based routing for Javascript",
4-
"version": "1.0.0-alpha.4",
4+
"version": "1.0.0-alpha.5",
55
"scripts": {},
66
"homepage": "http://angular-ui.github.com/ui-router",
77
"contributors": [
@@ -41,7 +41,13 @@
4141
},
4242
"license": "MIT",
4343
"devDependencies": {
44-
"angular2": "^2.0.0-beta.17",
44+
"@angular/common": "^2.0.0-rc.1",
45+
"@angular/compiler": "^2.0.0-rc.1",
46+
"@angular/core": "^2.0.0-rc.1",
47+
"@angular/platform-browser": "^2.0.0-rc.1",
48+
"@angular/platform-browser-dynamic": "^2.0.0-rc.1",
49+
"rxjs": "^5.0.0-beta.6",
50+
"zone.js": "^0.6.12",
4551
"babel-core": "^5.8.14",
4652
"conventional-changelog": "^1.1.0",
4753
"conventional-changelog-cli": "^1.1.1",
@@ -72,7 +78,6 @@
7278
"lodash": "^4.5.1",
7379
"phantomjs-polyfill": "0.0.1",
7480
"reflect-metadata": "=0.1.2",
75-
"rxjs": "=5.0.0-beta.2",
7681
"shelljs": "~0.6.0",
7782
"systemjs": "^0.18.4",
7883
"ts-loader": "^0.8.1",
@@ -81,11 +86,6 @@
8186
"typescript": "~1.8.0",
8287
"webpack": "1.x",
8388
"webpack-dev-server": "1.x",
84-
"yargs": "^4.2.0",
85-
"zone.js": "^0.6.6"
86-
},
87-
"dependencies": {
88-
"rxjs": "^5.0.0-beta.6",
89-
"zone.js": "^0.6.12"
89+
"yargs": "^4.2.0"
9090
}
9191
}

packages/ng2/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "ui-router-ng2",
33
"description": "State-based routing for Angular 2",
44
"peerDependencies": {
5-
"angular2": ">2.0.0-alpha.12"
5+
"@angular/core": ">=2.0.0-rc.1"
66
},
77
"main": "ng2.js",
88
"typings": "ng2.d.ts"

packages/ng2/webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ module.exports = {
4343
},
4444

4545
externals: {
46-
"angular2/core": { root: 'angular2/core', amd: 'angular2/core', commonjs2: 'angular2/core', commonjs: 'angular2/core' }
46+
"@angular/core": { root: '@angular/core', amd: '@angular/core', commonjs2: '@angular/core', commonjs: '@angular/core' }
4747
}
4848
};

src/ng2/componentUtil.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {InputMetadata, ComponentMetadata} from "angular2/core";
1+
import {InputMetadata, ComponentMetadata} from "@angular/core";
22

33
export const ng2ComponentInputs = (ng2CompClass) => {
44
/** Get "@Input('foo') _foo" inputs */

src/ng2/interface.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {StateDeclaration, _ViewDeclaration} from "../state/interface";
33
import {ParamDeclaration} from "../params/interface";
44
import {IInjectable} from "../common/common";
55
import {Transition} from "../transition/transition";
6-
import {Type} from "angular2/core";
6+
import {Type} from "@angular/core";
77

88
/**
99
* The StateDeclaration object is used to define a state or nested state.

src/ng2/providers.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* - When bootstrapping: include the [[UIROUTER_PROVIDERS]] and define a provider for your [[UIRouterConfig]]
3434
*
3535
* ```js
36-
* import {provide} from "angular2/core";
36+
* import {provide} from "@angular/core";
3737
* import {bootstrap} from 'angular2/platform/browser';
3838
* import {UIRouterConfig, UiView, UIROUTER_PROVIDERS} from "ui-router-ng2";
3939
* import {MyUIRouterConfig} from "./router.config";
@@ -46,7 +46,7 @@
4646
*
4747
* @preferred @module ng2
4848
*/ /** */
49-
import {Provider, provide} from "angular2/core";
49+
import {Provider, provide} from "@angular/core";
5050
import {UIRouter} from "../router";
5151
import {Node} from "../path/node";
5252
import {StateRegistry} from "../state/stateRegistry";

src/ng2/uiSref.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/** @module ng2_directives */ /** */
22
import {UIRouter} from "../router";
3-
import {Directive, Inject, Input} from "angular2/core";
4-
import {Optional} from "angular2/core";
5-
import {ElementRef} from "angular2/core";
6-
import {Renderer} from "angular2/core";
3+
import {Directive, Inject, Input} from "@angular/core";
4+
import {Optional} from "@angular/core";
5+
import {ElementRef} from "@angular/core";
6+
import {Renderer} from "@angular/core";
77
import {UiView, ParentUiViewInject} from "./uiView";
88
import {extend} from "../common/common";
99

src/ng2/uiSrefActive.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @module ng2_directives */ /** */
2-
import {Directive, Input, ElementRef, Host, Renderer} from "angular2/core";
2+
import {Directive, Input, ElementRef, Host, Renderer} from "@angular/core";
33
import {UiSrefStatus, SrefStatus} from "./uiSrefStatus";
44

55
/**

src/ng2/uiSrefStatus.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @module ng2_directives */ /** */
2-
import {Directive, Output, EventEmitter} from "angular2/core";
2+
import {Directive, Output, EventEmitter} from "@angular/core";
33
import {StateService} from "../state/stateService";
44
import {UiSref} from "./uiSref";
55
import {Node} from "../path/node";

src/ng2/uiView.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
import {
33
Component, ComponentResolver, ComponentFactory,
44
ViewContainerRef, ReflectiveInjector
5-
} from 'angular2/core';
6-
import {provide} from "angular2/core";
7-
import {Input} from "angular2/core";
8-
import {ComponentRef} from "angular2/core";
9-
import {Type} from "angular2/core";
5+
} from '@angular/core';
6+
import {provide} from "@angular/core";
7+
import {Input} from "@angular/core";
8+
import {ComponentRef} from "@angular/core";
9+
import {Type} from "@angular/core";
1010

1111
import {UIRouter} from "../router";
1212
import {trace} from "../common/trace";
13-
import {Inject} from "angular2/core";
13+
import {Inject} from "@angular/core";
1414
import {ViewContext, ViewConfig} from "../view/interface";
1515
import {Ng2ViewDeclaration} from "./interface";
1616
import {ng2ComponentInputs} from "./componentUtil";
@@ -96,7 +96,7 @@ export interface ParentUiViewInject {
9696
export class UiView {
9797
@Input('name') name: string;
9898
@Input('ui-view') set _name(val) { this.name = val; }
99-
componentRef: ComponentRef;
99+
componentRef: ComponentRef<any>;
100100
deregister: Function;
101101
uiViewData: any = {};
102102

@@ -161,7 +161,7 @@ export class UiView {
161161
// Get the component class from the view declaration. TODO: allow promises?
162162
let componentType = <Type> viewDecl.component;
163163

164-
let createComponent = (factory: ComponentFactory) => {
164+
let createComponent = (factory: ComponentFactory<any>) => {
165165
let parentInjector = this.viewContainerRef.injector;
166166
let childInjector = ReflectiveInjector.resolveAndCreate(rawProviders, parentInjector);
167167
let ref = this.componentRef = this.viewContainerRef.createComponent(factory, undefined, childInjector);

0 commit comments

Comments
 (0)