From 32194069fafe2c7fc8820e8baba20f7832bce9ca Mon Sep 17 00:00:00 2001 From: Chris Thielen Date: Wed, 4 May 2016 16:06:27 -0600 Subject: [PATCH] fix(ng2.UIRouter): Update ui-router for ng2 rc.1 Closes #2722 --- package.json | 18 +++++++++--------- packages/ng2/package.json | 2 +- packages/ng2/webpack.config.js | 2 +- src/ng2/componentUtil.ts | 2 +- src/ng2/interface.ts | 2 +- src/ng2/providers.ts | 4 ++-- src/ng2/uiSref.ts | 8 ++++---- src/ng2/uiSrefActive.ts | 2 +- src/ng2/uiSrefStatus.ts | 2 +- src/ng2/uiView.ts | 16 ++++++++-------- 10 files changed, 29 insertions(+), 29 deletions(-) diff --git a/package.json b/package.json index 34ae65752..646324c2e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ui-router", "description": "State-based routing for Javascript", - "version": "1.0.0-alpha.4", + "version": "1.0.0-alpha.5", "scripts": {}, "homepage": "http://angular-ui.github.com/ui-router", "contributors": [ @@ -41,7 +41,13 @@ }, "license": "MIT", "devDependencies": { - "angular2": "^2.0.0-beta.17", + "@angular/common": "^2.0.0-rc.1", + "@angular/compiler": "^2.0.0-rc.1", + "@angular/core": "^2.0.0-rc.1", + "@angular/platform-browser": "^2.0.0-rc.1", + "@angular/platform-browser-dynamic": "^2.0.0-rc.1", + "rxjs": "^5.0.0-beta.6", + "zone.js": "^0.6.12", "babel-core": "^5.8.14", "conventional-changelog": "^1.1.0", "conventional-changelog-cli": "^1.1.1", @@ -72,7 +78,6 @@ "lodash": "^4.5.1", "phantomjs-polyfill": "0.0.1", "reflect-metadata": "=0.1.2", - "rxjs": "=5.0.0-beta.2", "shelljs": "~0.6.0", "systemjs": "^0.18.4", "ts-loader": "^0.8.1", @@ -81,11 +86,6 @@ "typescript": "~1.8.0", "webpack": "1.x", "webpack-dev-server": "1.x", - "yargs": "^4.2.0", - "zone.js": "^0.6.6" - }, - "dependencies": { - "rxjs": "^5.0.0-beta.6", - "zone.js": "^0.6.12" + "yargs": "^4.2.0" } } diff --git a/packages/ng2/package.json b/packages/ng2/package.json index 2ac4a5f6b..dc6d4edb2 100644 --- a/packages/ng2/package.json +++ b/packages/ng2/package.json @@ -2,7 +2,7 @@ "name": "ui-router-ng2", "description": "State-based routing for Angular 2", "peerDependencies": { - "angular2": ">2.0.0-alpha.12" + "@angular/core": ">=2.0.0-rc.1" }, "main": "ng2.js", "typings": "ng2.d.ts" diff --git a/packages/ng2/webpack.config.js b/packages/ng2/webpack.config.js index 7cecd002f..8031dcafa 100644 --- a/packages/ng2/webpack.config.js +++ b/packages/ng2/webpack.config.js @@ -43,6 +43,6 @@ module.exports = { }, externals: { - "angular2/core": { root: 'angular2/core', amd: 'angular2/core', commonjs2: 'angular2/core', commonjs: 'angular2/core' } + "@angular/core": { root: '@angular/core', amd: '@angular/core', commonjs2: '@angular/core', commonjs: '@angular/core' } } }; diff --git a/src/ng2/componentUtil.ts b/src/ng2/componentUtil.ts index bdf9399eb..bf139434c 100644 --- a/src/ng2/componentUtil.ts +++ b/src/ng2/componentUtil.ts @@ -1,4 +1,4 @@ -import {InputMetadata, ComponentMetadata} from "angular2/core"; +import {InputMetadata, ComponentMetadata} from "@angular/core"; export const ng2ComponentInputs = (ng2CompClass) => { /** Get "@Input('foo') _foo" inputs */ diff --git a/src/ng2/interface.ts b/src/ng2/interface.ts index c94e63706..26390b8e7 100644 --- a/src/ng2/interface.ts +++ b/src/ng2/interface.ts @@ -3,7 +3,7 @@ import {StateDeclaration, _ViewDeclaration} from "../state/interface"; import {ParamDeclaration} from "../params/interface"; import {IInjectable} from "../common/common"; import {Transition} from "../transition/transition"; -import {Type} from "angular2/core"; +import {Type} from "@angular/core"; /** * The StateDeclaration object is used to define a state or nested state. diff --git a/src/ng2/providers.ts b/src/ng2/providers.ts index 6efc88b71..75443730e 100644 --- a/src/ng2/providers.ts +++ b/src/ng2/providers.ts @@ -33,7 +33,7 @@ * - When bootstrapping: include the [[UIROUTER_PROVIDERS]] and define a provider for your [[UIRouterConfig]] * * ```js - * import {provide} from "angular2/core"; + * import {provide} from "@angular/core"; * import {bootstrap} from 'angular2/platform/browser'; * import {UIRouterConfig, UiView, UIROUTER_PROVIDERS} from "ui-router-ng2"; * import {MyUIRouterConfig} from "./router.config"; @@ -46,7 +46,7 @@ * * @preferred @module ng2 */ /** */ -import {Provider, provide} from "angular2/core"; +import {Provider, provide} from "@angular/core"; import {UIRouter} from "../router"; import {Node} from "../path/node"; import {StateRegistry} from "../state/stateRegistry"; diff --git a/src/ng2/uiSref.ts b/src/ng2/uiSref.ts index 6ea994997..50dbcaf7c 100644 --- a/src/ng2/uiSref.ts +++ b/src/ng2/uiSref.ts @@ -1,9 +1,9 @@ /** @module ng2_directives */ /** */ import {UIRouter} from "../router"; -import {Directive, Inject, Input} from "angular2/core"; -import {Optional} from "angular2/core"; -import {ElementRef} from "angular2/core"; -import {Renderer} from "angular2/core"; +import {Directive, Inject, Input} from "@angular/core"; +import {Optional} from "@angular/core"; +import {ElementRef} from "@angular/core"; +import {Renderer} from "@angular/core"; import {UiView, ParentUiViewInject} from "./uiView"; import {extend} from "../common/common"; diff --git a/src/ng2/uiSrefActive.ts b/src/ng2/uiSrefActive.ts index 50caf2825..af661ebd5 100644 --- a/src/ng2/uiSrefActive.ts +++ b/src/ng2/uiSrefActive.ts @@ -1,5 +1,5 @@ /** @module ng2_directives */ /** */ -import {Directive, Input, ElementRef, Host, Renderer} from "angular2/core"; +import {Directive, Input, ElementRef, Host, Renderer} from "@angular/core"; import {UiSrefStatus, SrefStatus} from "./uiSrefStatus"; /** diff --git a/src/ng2/uiSrefStatus.ts b/src/ng2/uiSrefStatus.ts index 9857e2cf7..97623b543 100644 --- a/src/ng2/uiSrefStatus.ts +++ b/src/ng2/uiSrefStatus.ts @@ -1,5 +1,5 @@ /** @module ng2_directives */ /** */ -import {Directive, Output, EventEmitter} from "angular2/core"; +import {Directive, Output, EventEmitter} from "@angular/core"; import {StateService} from "../state/stateService"; import {UiSref} from "./uiSref"; import {Node} from "../path/node"; diff --git a/src/ng2/uiView.ts b/src/ng2/uiView.ts index ac56241e8..f3131caa9 100755 --- a/src/ng2/uiView.ts +++ b/src/ng2/uiView.ts @@ -2,15 +2,15 @@ import { Component, ComponentResolver, ComponentFactory, ViewContainerRef, ReflectiveInjector -} from 'angular2/core'; -import {provide} from "angular2/core"; -import {Input} from "angular2/core"; -import {ComponentRef} from "angular2/core"; -import {Type} from "angular2/core"; +} from '@angular/core'; +import {provide} from "@angular/core"; +import {Input} from "@angular/core"; +import {ComponentRef} from "@angular/core"; +import {Type} from "@angular/core"; import {UIRouter} from "../router"; import {trace} from "../common/trace"; -import {Inject} from "angular2/core"; +import {Inject} from "@angular/core"; import {ViewContext, ViewConfig} from "../view/interface"; import {Ng2ViewDeclaration} from "./interface"; import {ng2ComponentInputs} from "./componentUtil"; @@ -96,7 +96,7 @@ export interface ParentUiViewInject { export class UiView { @Input('name') name: string; @Input('ui-view') set _name(val) { this.name = val; } - componentRef: ComponentRef; + componentRef: ComponentRef; deregister: Function; uiViewData: any = {}; @@ -161,7 +161,7 @@ export class UiView { // Get the component class from the view declaration. TODO: allow promises? let componentType = viewDecl.component; - let createComponent = (factory: ComponentFactory) => { + let createComponent = (factory: ComponentFactory) => { let parentInjector = this.viewContainerRef.injector; let childInjector = ReflectiveInjector.resolveAndCreate(rawProviders, parentInjector); let ref = this.componentRef = this.viewContainerRef.createComponent(factory, undefined, childInjector);