diff --git a/src/common/interface.ts b/src/common/interface.ts index 69b0d9236..8983cc1a7 100644 --- a/src/common/interface.ts +++ b/src/common/interface.ts @@ -3,7 +3,7 @@ /** * An interface for getting values from dependency injection. */ -export interface UiInjector { +export interface UIInjector { /** * Gets a value from the injector * diff --git a/src/common/trace.ts b/src/common/trace.ts index f622090cb..d8db8c80c 100644 --- a/src/common/trace.ts +++ b/src/common/trace.ts @@ -32,7 +32,7 @@ import {parse} from "../common/hof"; import {isNumber} from "../common/predicates"; import {Transition} from "../transition/transition"; -import {ActiveUiView, ViewConfig} from "../view/interface"; +import {ActiveUIView, ViewConfig} from "../view/interface"; import {stringify, functionToString, maxLength, padString} from "./strings"; import {Resolvable} from "../resolve/resolvable"; import {PathNode} from "../path/node"; @@ -211,27 +211,27 @@ export class Trace { } /** called by ui-router code */ - traceUiViewEvent(event: string, viewData: ActiveUiView, extra = "") { + traceUIViewEvent(event: string, viewData: ActiveUIView, extra = "") { if (!this.enabled(Category.UIVIEW)) return; console.log(`ui-view: ${padString(30, event)} ${uiViewString(viewData)}${extra}`); } /** called by ui-router code */ - traceUiViewConfigUpdated(viewData: ActiveUiView, context) { + traceUIViewConfigUpdated(viewData: ActiveUIView, context) { if (!this.enabled(Category.UIVIEW)) return; - this.traceUiViewEvent("Updating", viewData, ` with ViewConfig from context='${context}'`); + this.traceUIViewEvent("Updating", viewData, ` with ViewConfig from context='${context}'`); } /** called by ui-router code */ - traceUiViewScopeCreated(viewData: ActiveUiView, newScope) { + traceUIViewScopeCreated(viewData: ActiveUIView, newScope) { if (!this.enabled(Category.UIVIEW)) return; - this.traceUiViewEvent("Created scope for", viewData, `, scope #${newScope.$id}`); + this.traceUIViewEvent("Created scope for", viewData, `, scope #${newScope.$id}`); } /** called by ui-router code */ - traceUiViewFill(viewData: ActiveUiView, html) { + traceUIViewFill(viewData: ActiveUIView, html) { if (!this.enabled(Category.UIVIEW)) return; - this.traceUiViewEvent("Fill", viewData, ` with: ${maxLength(200, html)}`); + this.traceUIViewEvent("Fill", viewData, ` with: ${maxLength(200, html)}`); } /** called by ui-router code */ @@ -241,7 +241,7 @@ export class Trace { } /** called by ui-router code */ - traceViewServiceUiViewEvent(event: string, viewData: ActiveUiView) { + traceViewServiceUIViewEvent(event: string, viewData: ActiveUIView) { if (!this.enabled(Category.VIEWCONFIG)) return; console.log(`VIEWCONFIG: ${event} ${uiViewString(viewData)}`); } diff --git a/src/core.ts b/src/core.ts index 2a032765f..dafa9f409 100644 --- a/src/core.ts +++ b/src/core.ts @@ -10,4 +10,4 @@ export * from "./url/module"; export * from "./view/module"; export * from "./globals"; -export { UiRouter } from "./router"; +export { UIRouter } from "./router"; diff --git a/src/globals.ts b/src/globals.ts index 68702317b..7a02a2bc1 100644 --- a/src/globals.ts +++ b/src/globals.ts @@ -14,7 +14,7 @@ import {Observable} from "rxjs/Rx"; * This is where we hold the global mutable state such as current state, current * params, current transition, etc. */ -export interface UiRouterGlobals { +export interface UIRouterGlobals { /** * Current parameter values * @@ -43,7 +43,7 @@ export interface UiRouterGlobals { /** * Global mutable state */ -export class Globals implements UiRouterGlobals { +export class Globals implements UIRouterGlobals { params: StateParams = new StateParams(); current: StateDeclaration; $current: State; diff --git a/src/ng1/directives/stateDirectives.ts b/src/ng1/directives/stateDirectives.ts index 382983b37..5f7855702 100644 --- a/src/ng1/directives/stateDirectives.ts +++ b/src/ng1/directives/stateDirectives.ts @@ -7,7 +7,7 @@ */ /** for typedoc */ import {extend, forEach, toJson, tail} from "../../common/common"; import {isString, isObject} from "../../common/predicates"; -import {UiViewData} from "./viewDirective"; +import {UIViewData} from "./viewDirective"; import {parse} from "../../common/hof"; import {PathNode} from "../../path/node"; @@ -22,7 +22,7 @@ function parseStateRef(ref, current) { /** @hidden */ function stateContext(el) { - let $uiView: UiViewData = el.parent().inheritedData('$uiView'); + let $uiView: UIViewData = el.parent().inheritedData('$uiView'); let path: PathNode[] = parse('$cfg.path')($uiView); return path ? tail(path).state.name : undefined; } diff --git a/src/ng1/directives/viewDirective.ts b/src/ng1/directives/viewDirective.ts index 18f7acdd5..634c2ca05 100644 --- a/src/ng1/directives/viewDirective.ts +++ b/src/ng1/directives/viewDirective.ts @@ -3,7 +3,7 @@ import {extend, unnestR, filter, tail} from "../../common/common"; import {isDefined, isFunction, isString} from "../../common/predicates"; import {trace} from "../../common/trace"; -import {ActiveUiView} from "../../view/interface"; +import {ActiveUIView} from "../../view/interface"; import {Ng1ViewConfig} from "../statebuilders/views"; import {TransitionService} from "../../transition/transitionService"; import {parse} from "../../common/hof"; @@ -17,9 +17,9 @@ import {Ng1Controller, Ng1StateDeclaration} from "../interface"; import {getLocals} from "../services"; /** @hidden */ -export type UiViewData = { +export type UIViewData = { $cfg: Ng1ViewConfig; - $uiView: ActiveUiView; + $uiView: ActiveUIView; $animEnter: Promise; $animLeave: Promise; @@ -203,7 +203,7 @@ function $ViewDirective( $view, $animate, $uiViewScroll, $interpolate, inherited = $element.inheritedData('$uiView') || rootData, name = $interpolate(attrs.uiView || attrs.name || '')(scope) || '$default'; - let activeUiView: ActiveUiView = { + let activeUIView: ActiveUIView = { $type: 'ng1', id: directive.count++, // Global sequential ID for ui-view tags added to DOM name: name, // ui-view name (
@@ -215,43 +215,43 @@ function $ViewDirective( $view, $animate, $uiViewScroll, $interpolate, } }; - trace.traceUiViewEvent("Linking", activeUiView); + trace.traceUIViewEvent("Linking", activeUIView); function configUpdatedCallback(config?: Ng1ViewConfig) { if (config && !(config instanceof Ng1ViewConfig)) return; if (configsEqual(viewConfig, config)) return; - trace.traceUiViewConfigUpdated(activeUiView, config && config.viewDecl && config.viewDecl.$context); + trace.traceUIViewConfigUpdated(activeUIView, config && config.viewDecl && config.viewDecl.$context); viewConfig = config; updateView(config); } - $element.data('$uiView', { $uiView: activeUiView }); + $element.data('$uiView', { $uiView: activeUIView }); updateView(); - unregister = $view.registerUiView(activeUiView); + unregister = $view.registerUIView(activeUIView); scope.$on("$destroy", function() { - trace.traceUiViewEvent("Destroying/Unregistering", activeUiView); + trace.traceUIViewEvent("Destroying/Unregistering", activeUIView); unregister(); }); function cleanupLastView() { if (previousEl) { - trace.traceUiViewEvent("Removing (previous) el", previousEl.data('$uiView')); + trace.traceUIViewEvent("Removing (previous) el", previousEl.data('$uiView')); previousEl.remove(); previousEl = null; } if (currentScope) { - trace.traceUiViewEvent("Destroying scope", activeUiView); + trace.traceUIViewEvent("Destroying scope", activeUIView); currentScope.$destroy(); currentScope = null; } if (currentEl) { let _viewData = currentEl.data('$uiView'); - trace.traceUiViewEvent("Animate out", _viewData); + trace.traceUIViewEvent("Animate out", _viewData); renderer.leave(currentEl, function() { _viewData.$$animLeave.resolve(); previousEl = null; @@ -264,19 +264,19 @@ function $ViewDirective( $view, $animate, $uiViewScroll, $interpolate, function updateView(config?: Ng1ViewConfig) { let newScope = scope.$new(); - trace.traceUiViewScopeCreated(activeUiView, newScope); + trace.traceUIViewScopeCreated(activeUIView, newScope); let animEnter = $q.defer(), animLeave = $q.defer(); - let $uiViewData: UiViewData = { + let $uiViewData: UIViewData = { $cfg: config, - $uiView: activeUiView, + $uiView: activeUIView, $animEnter: animEnter.promise, $animLeave: animLeave.promise, $$animLeave: animLeave }; let cloned = $transclude(newScope, function(clone) { - renderer.enter(clone.data('$uiView', $uiViewData), $element, function onUiViewEnter() { + renderer.enter(clone.data('$uiView', $uiViewData), $element, function onUIViewEnter() { animEnter.resolve(); if (currentScope) currentScope.$emit('$viewContentAnimationEnded'); @@ -323,12 +323,12 @@ function $ViewDirectiveFill ( $compile, $controller, $transitions, $view, let initial = tElement.html(); return function (scope, $element) { - let data: UiViewData = $element.data('$uiView'); + let data: UIViewData = $element.data('$uiView'); if (!data) return; let cfg: Ng1ViewConfig = data.$cfg || { viewDecl: {} }; $element.html(cfg.template || initial); - trace.traceUiViewFill(data.$uiView, $element.html()); + trace.traceUIViewFill(data.$uiView, $element.html()); let link = $compile($element.contents()); let controller = cfg.controller; diff --git a/src/ng1/services.ts b/src/ng1/services.ts index 0d205cf34..5f4004b1a 100644 --- a/src/ng1/services.ts +++ b/src/ng1/services.ts @@ -3,14 +3,14 @@ * * - Provides an implementation for the [[CoreServices]] API, based on angular 1 services. * - Also registers some services with the angular 1 injector. - * - Creates and bootstraps a new [[UiRouter]] object. Ties it to the the angular 1 lifecycle. + * - Creates and bootstraps a new [[UIRouter]] object. Ties it to the the angular 1 lifecycle. * * @module ng1 * @preferred */ /** for typedoc */ -import {UiRouter} from "../router"; +import {UIRouter} from "../router"; import {services} from "../common/coreservices"; import {bindFunctions, removeFrom, applyPairs} from "../common/common"; import {prop} from "../common/hof"; @@ -156,14 +156,14 @@ function runBlock($injector, $q) { app.run(runBlock); -let router: UiRouter = null; +let router: UIRouter = null; -ng1UiRouter.$inject = ['$locationProvider']; +ng1UIRouter.$inject = ['$locationProvider']; /** This angular 1 provider instantiates a Router and exposes its services via the angular injector */ -function ng1UiRouter($locationProvider) { +function ng1UIRouter($locationProvider) { - // Create a new instance of the Router when the ng1UiRouterProvider is initialized - router = new UiRouter(); + // Create a new instance of the Router when the ng1UIRouterProvider is initialized + router = new UIRouter(); // Apply ng1 specific StateBuilder code for `views`, `resolve`, and `onExit/Retain/Enter` properties router.stateRegistry.decorator("views", ng1ViewsBuilder); @@ -211,17 +211,17 @@ function ng1UiRouter($locationProvider) { } } -function $stateParamsFactory(ng1UiRouter) { - return ng1UiRouter.globals.params; +function $stateParamsFactory(ng1UIRouter) { + return ng1UIRouter.globals.params; } // The 'ui.router' ng1 module depends on 'ui.router.init' module. -angular.module('ui.router.init', []).provider("ng1UiRouter", ng1UiRouter); +angular.module('ui.router.init', []).provider("ng1UIRouter", ng1UIRouter); // This effectively calls $get() to init when we enter runtime -angular.module('ui.router.init').run(['ng1UiRouter', function(ng1UiRouter) { }]); +angular.module('ui.router.init').run(['ng1UIRouter', function(ng1UIRouter) { }]); // $urlMatcherFactory service and $urlMatcherFactoryProvider -angular.module('ui.router.util').provider('$urlMatcherFactory', ['ng1UiRouterProvider', () => router.urlMatcherFactory]); +angular.module('ui.router.util').provider('$urlMatcherFactory', ['ng1UIRouterProvider', () => router.urlMatcherFactory]); angular.module('ui.router.util').run(['$urlMatcherFactory', function($urlMatcherFactory) { }]); // $urlRouter service and $urlRouterProvider @@ -233,7 +233,7 @@ function getUrlRouterProvider() { }; return router.urlRouterProvider; } -angular.module('ui.router.router').provider('$urlRouter', ['ng1UiRouterProvider', getUrlRouterProvider]); +angular.module('ui.router.router').provider('$urlRouter', ['ng1UIRouterProvider', getUrlRouterProvider]); angular.module('ui.router.router').run(['$urlRouter', function($urlRouter) { }]); // $state service and $stateProvider @@ -246,22 +246,22 @@ function getStateProvider() { }; return router.stateProvider; } -angular.module('ui.router.state').provider('$state', ['ng1UiRouterProvider', getStateProvider]); +angular.module('ui.router.state').provider('$state', ['ng1UIRouterProvider', getStateProvider]); angular.module('ui.router.state').run(['$state', function($state) { }]); // $stateParams service -angular.module('ui.router.state').factory('$stateParams', ['ng1UiRouter', (ng1UiRouter) => - ng1UiRouter.globals.params]); +angular.module('ui.router.state').factory('$stateParams', ['ng1UIRouter', (ng1UIRouter) => + ng1UIRouter.globals.params]); // $transitions service and $transitionsProvider function getTransitionsProvider() { router.transitionService["$get"] = () => router.transitionService; return router.transitionService; } -angular.module('ui.router.state').provider('$transitions', ['ng1UiRouterProvider', getTransitionsProvider]); +angular.module('ui.router.state').provider('$transitions', ['ng1UIRouterProvider', getTransitionsProvider]); // $templateFactory service -angular.module('ui.router.util').factory('$templateFactory', ['ng1UiRouter', () => new TemplateFactory()]); +angular.module('ui.router.util').factory('$templateFactory', ['ng1UIRouter', () => new TemplateFactory()]); // The $view service angular.module('ui.router').factory('$view', () => router.viewService); @@ -283,16 +283,16 @@ export const getLocals = (ctx: ResolveContext) => { return tuples.reduce(applyPairs, {}); }; -/** Adds the angular 1 `$injector` to the `UiInjector` interface */ +/** Adds the angular 1 `$injector` to the `UIInjector` interface */ declare module "../common/interface" { /** - * This enhances the [[common.UiInjector]] interface by adding the `$injector` service as the [[native]] injector. + * This enhances the [[common.UIInjector]] interface by adding the `$injector` service as the [[native]] injector. */ - interface UiInjector { + interface UIInjector { /** * The native Angular 1 `$injector` service * - * When you have access to a `UiInjector`, this property will contain the native `$injector` Angular 1 service. + * When you have access to a `UIInjector`, this property will contain the native `$injector` Angular 1 service. * * @example: * ```js diff --git a/src/ng1/statebuilders/views.ts b/src/ng1/statebuilders/views.ts index 1b922766d..653544ce0 100644 --- a/src/ng1/statebuilders/views.ts +++ b/src/ng1/statebuilders/views.ts @@ -69,7 +69,7 @@ export function ng1ViewsBuilder(state: State) { config.$context = state; config.$name = name; - let normalized = ViewService.normalizeUiViewTarget(config.$context, config.$name); + let normalized = ViewService.normalizeUIViewTarget(config.$context, config.$name); config.$uiViewName = normalized.uiViewName; config.$uiViewContextAnchor = normalized.uiViewContextAnchor; diff --git a/src/ng2/directives/directives.ts b/src/ng2/directives/directives.ts index caa848328..b1225b446 100644 --- a/src/ng2/directives/directives.ts +++ b/src/ng2/directives/directives.ts @@ -1,16 +1,16 @@ /** * The UI-Router Angular 2 directives: * - * - [[UiView]]: A viewport for routed components - * - [[UiSref]]: A state ref to a target state; navigates when clicked - * - [[UiSrefActive]]: (and `UiSrefActiveEq`) Adds a css class when a UiSref's target state (or a child state) is active + * - [[UIView]]: A viewport for routed components + * - [[UISref]]: A state ref to a target state; navigates when clicked + * - [[UISrefActive]]: (and `UISrefActiveEq`) Adds a css class when a UISref's target state (or a child state) is active * * @preferred @module ng2_directives */ /** */ -import {UiSref, AnchorUiSref} from "./uiSref"; -import {UiSrefActive} from "./uiSrefActive"; -import {UiView} from "./uiView"; -import {UiSrefStatus} from "./uiSrefStatus"; +import {UISref, AnchorUISref} from "./uiSref"; +import {UISrefActive} from "./uiSrefActive"; +import {UIView} from "./uiView"; +import {UISrefStatus} from "./uiSrefStatus"; export * from "./uiView"; export * from "./uiSref"; @@ -30,4 +30,4 @@ export * from "./uiSrefActive"; * }) * ``` */ -export let UIROUTER_DIRECTIVES = [UiSref, AnchorUiSref, UiView, UiSrefActive, UiSrefStatus]; +export let UIROUTER_DIRECTIVES = [UISref, AnchorUISref, UIView, UISrefActive, UISrefStatus]; diff --git a/src/ng2/directives/uiSref.ts b/src/ng2/directives/uiSref.ts index 4a27418fd..4ba51fab5 100644 --- a/src/ng2/directives/uiSref.ts +++ b/src/ng2/directives/uiSref.ts @@ -1,15 +1,15 @@ /** @module ng2_directives */ /** */ -import {UiRouter} from "../../router"; +import {UIRouter} from "../../router"; 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 {UIView, ParentUIViewInject} from "./uiView"; import {extend} from "../../common/common"; /** @hidden */ @Directive({ selector: 'a[uiSref]' }) -export class AnchorUiSref { +export class AnchorUISref { constructor(public _el: ElementRef, public _renderer: Renderer) { } update(href) { this._renderer.setElementProperty(this._el.nativeElement, 'href', href); @@ -61,15 +61,15 @@ export class AnchorUiSref { selector: '[uiSref]', host: { '(click)': 'go()' } }) -export class UiSref { +export class UISref { @Input('uiSref') state: string; @Input('uiParams') params: any; @Input('uiOptions') options: any; constructor( - private _router: UiRouter, - @Inject(UiView.PARENT_INJECT) public parent: ParentUiViewInject, - @Optional() private _anchorUiSref: AnchorUiSref + private _router: UIRouter, + @Inject(UIView.PARENT_INJECT) public parent: ParentUIViewInject, + @Optional() private _anchorUISref: AnchorUISref ) { } set "uiSref"(val) { this.state = val; this.update(); } @@ -81,8 +81,8 @@ export class UiSref { } update() { - if (this._anchorUiSref) { - this._anchorUiSref.update(this._router.stateService.href(this.state, this.params, this.getOptions())); + if (this._anchorUISref) { + this._anchorUISref.update(this._router.stateService.href(this.state, this.params, this.getOptions())); } } diff --git a/src/ng2/directives/uiSrefActive.ts b/src/ng2/directives/uiSrefActive.ts index af661ebd5..6c97b0e27 100644 --- a/src/ng2/directives/uiSrefActive.ts +++ b/src/ng2/directives/uiSrefActive.ts @@ -1,13 +1,13 @@ /** @module ng2_directives */ /** */ import {Directive, Input, ElementRef, Host, Renderer} from "@angular/core"; -import {UiSrefStatus, SrefStatus} from "./uiSrefStatus"; +import {UISrefStatus, SrefStatus} from "./uiSrefStatus"; /** * A directive that adds a CSS class when a `uiSref` is active. * * ### Purpose * - * This directive should be paired with a [[UiSref]], and is used to apply a CSS class to the element when + * This directive should be paired with a [[UISref]], and is used to apply a CSS class to the element when * the state that the `uiSref` targets is active. * * ### Selectors @@ -30,7 +30,7 @@ import {UiSrefStatus, SrefStatus} from "./uiSrefStatus"; @Directive({ selector: '[uiSrefActive],[uiSrefActiveEq]' }) -export class UiSrefActive { +export class UISrefActive { private _classes: string[] = []; @Input('uiSrefActive') set active(val) { this._classes = val.split("\s+")}; @@ -38,7 +38,7 @@ export class UiSrefActive { private _classesEq: string[] = []; @Input('uiSrefActiveEq') set activeEq(val) { this._classesEq = val.split("\s+")}; - constructor(uiSrefStatus: UiSrefStatus, rnd: Renderer, @Host() host: ElementRef) { + constructor(uiSrefStatus: UISrefStatus, rnd: Renderer, @Host() host: ElementRef) { uiSrefStatus.uiSrefStatus.subscribe((next: SrefStatus) => { this._classes.forEach(cls => rnd.setElementClass(host.nativeElement, cls, next.active)); this._classesEq.forEach(cls => rnd.setElementClass(host.nativeElement, cls, next.exact)); diff --git a/src/ng2/directives/uiSrefStatus.ts b/src/ng2/directives/uiSrefStatus.ts index 71b92acbc..92da7c33d 100644 --- a/src/ng2/directives/uiSrefStatus.ts +++ b/src/ng2/directives/uiSrefStatus.ts @@ -1,7 +1,7 @@ /** @module ng2_directives */ /** */ import {Directive, Output, EventEmitter} from "@angular/core"; import {StateService} from "../../state/stateService"; -import {UiSref} from "./uiSref"; +import {UISref} from "./uiSref"; import {PathNode} from "../../path/node"; import {TransitionService} from "../../transition/transitionService"; import {Transition} from "../../transition/transition"; @@ -9,7 +9,7 @@ import {TargetState} from "../../state/targetState"; import {TreeChanges} from "../../transition/interface"; import {State} from "../../state/stateObject"; import {anyTrueR, tail, unnestR} from "../../common/common"; -import {UiRouterGlobals, Globals} from "../../globals"; +import {UIRouterGlobals, Globals} from "../../globals"; import {Param} from "../../params/param"; import {PathFactory} from "../../path/pathFactory"; @@ -28,9 +28,9 @@ export interface SrefStatus { } /** - * A directive (which pairs with a [[UiSref]]) and emits events when the UiSref status changes. + * A directive (which pairs with a [[UISref]]) and emits events when the UISref status changes. * - * This directive is used by the [[UiSrefActive]] directive. + * This directive is used by the [[UISrefActive]] directive. * * The event emitted is of type [[SrefStatus]], and has boolean values for `active`, `exact`, `entering`, and `exiting` * @@ -39,7 +39,7 @@ export interface SrefStatus { * This API is subject to change. */ @Directive({ selector: '[uiSrefStatus],[uiSrefActive],[uiSrefActiveEq]' }) -export class UiSrefStatus { +export class UISrefStatus { private _deregisterHook; // current statuses of the state/params the uiSref directive is linking to @@ -55,7 +55,7 @@ export class UiSrefStatus { constructor(transitionService: TransitionService, private _globals: Globals, private _stateService: StateService, - public sref: UiSref) { + public sref: UISref) { this._deregisterHook = transitionService.onStart({}, $transition$ => this.processTransition($transition$)); } diff --git a/src/ng2/directives/uiView.ts b/src/ng2/directives/uiView.ts index 4cac85ee6..b270322b2 100755 --- a/src/ng2/directives/uiView.ts +++ b/src/ng2/directives/uiView.ts @@ -8,7 +8,7 @@ import {Input} from "@angular/core"; import {ComponentRef} from "@angular/core"; import {Type} from "@angular/core"; -import {UiRouter} from "../../router"; +import {UIRouter} from "../../router"; import {trace} from "../../common/trace"; import {Inject} from "@angular/core"; import {ViewContext, ViewConfig} from "../../view/interface"; @@ -19,8 +19,8 @@ import {ResolveContext} from "../../resolve/resolveContext"; /** @hidden */ let id = 0; -// These are provide()d as the string UiView.PARENT_INJECT -export interface ParentUiViewInject { +// These are provide()d as the string UIView.PARENT_INJECT +export interface ParentUIViewInject { context: ViewContext; fqn: string; } @@ -121,18 +121,18 @@ const ng2ComponentInputs = (ng2CompClass) => { // // ` }) -export class UiView { +export class UIView { @Input('name') name: string; @Input('ui-view') set _name(val) { this.name = val; } componentRef: ComponentRef; deregister: Function; uiViewData: any = {}; - static PARENT_INJECT = "UiView.PARENT_INJECT"; + static PARENT_INJECT = "UIView.PARENT_INJECT"; constructor( - public router: UiRouter, - @Inject(UiView.PARENT_INJECT) public parent: ParentUiViewInject, + public router: UIRouter, + @Inject(UIView.PARENT_INJECT) public parent: ParentUIViewInject, public compResolver: ComponentResolver, public viewContainerRef: ViewContainerRef ) { } @@ -151,7 +151,7 @@ export class UiView { config: undefined }; - this.deregister = this.router.viewService.registerUiView(this.uiViewData); + this.deregister = this.router.viewService.registerUIView(this.uiViewData); } disposeLast() { @@ -175,16 +175,16 @@ export class UiView { if (uiViewData.config === config) return; // This is a new viewconfig. Destroy the old component this.disposeLast(); - trace.traceUiViewConfigUpdated(uiViewData, config && config.viewDecl.$context); + trace.traceUIViewConfigUpdated(uiViewData, config && config.viewDecl.$context); uiViewData.config = config; - // The config may be undefined if there is nothing state currently targeting this UiView. + // The config may be undefined if there is nothing state currently targeting this UIView. if (!config) return; // Map resolves to "useValue providers" let context = new ResolveContext(config.path); let resolvables = context.getTokens().map(token => context.getResolvable(token)).filter(r => r.resolved); let rawProviders = resolvables.map(r => ({ provide: r.token, useValue: r.data })); - rawProviders.push({ provide: UiView.PARENT_INJECT, useValue: { context: config.viewDecl.$context, fqn: uiViewData.fqn } }); + rawProviders.push({ provide: UIView.PARENT_INJECT, useValue: { context: config.viewDecl.$context, fqn: uiViewData.fqn } }); // Get the component class from the view declaration. TODO: allow promises? let componentType = viewDecl.component; diff --git a/src/ng2/location.ts b/src/ng2/location.ts index 9a1fee75c..6dc3c8050 100644 --- a/src/ng2/location.ts +++ b/src/ng2/location.ts @@ -12,7 +12,7 @@ const splitOnEquals = beforeAfterSubstr("="); const splitOnQuestionMark = beforeAfterSubstr("?"); @Injectable() -export class UiRouterLocation { +export class UIRouterLocation { isHashBang: boolean; hashPrefix: string = ""; diff --git a/src/ng2/providers.ts b/src/ng2/providers.ts index c18dff8f6..78ae391fa 100644 --- a/src/ng2/providers.ts +++ b/src/ng2/providers.ts @@ -13,16 +13,16 @@ * ``` * * - When defining a component, add the [[UIROUTER_DIRECTIVES]] to `directives:` array. - * - Either bootstrap a [[UiView]] component, or add a `` viewport to your root component. + * - Either bootstrap a [[UIView]] component, or add a `` viewport to your root component. * - Create application states (as defined by [[Ng2StateDeclaration]]) which will fill in the viewports. - * - Create a [[UiRouterConfig]], and register your states in the [[UIRouterConfig.configure]] function. + * - Create a [[UIRouterConfig]], and register your states in the [[UIRouterConfig.configure]] function. * * ```js - * import {UiRouter} from "ui-router-ng2"; + * import {UIRouter} from "ui-router-ng2"; * import {INITIAL_STATES} from "./app.states"; * @ Injectable() - * export class MyUiRouterConfig { - * configure(uiRouter: UiRouter) { + * export class MyUIRouterConfig { + * configure(uiRouter: UIRouter) { * INITIAL_STATES.forEach(function(state) { * uiRouter.stateRegistry.register(state)); * }); @@ -30,24 +30,24 @@ * } * ``` * - * - When bootstrapping: include the [[UIROUTER_PROVIDERS]] and define a provider for your [[UiRouterConfig]] + * - When bootstrapping: include the [[UIROUTER_PROVIDERS]] and define a provider for your [[UIRouterConfig]] * * ```js * 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"; + * import {UIRouterConfig, UIView, UIROUTER_PROVIDERS} from "ui-router-ng2"; + * import {MyUIRouterConfig} from "./router.config"; * - * bootstrap(UiView, [ + * bootstrap(UIView, [ * ...UIROUTER_PROVIDERS, - * provide(UiRouterConfig, { useClass: MyUiRouterConfig }) + * provide(UIRouterConfig, { useClass: MyUIRouterConfig }) * ]); * ``` * * @preferred @module ng2 */ /** */ import {Injector} from "@angular/core"; -import {UiRouter} from "../router"; +import {UIRouter} from "../router"; import {PathNode} from "../path/node"; import {StateRegistry} from "../state/stateRegistry"; import {StateService} from "../state/stateService"; @@ -55,18 +55,18 @@ import {TransitionService} from "../transition/transitionService"; import {UrlMatcherFactory} from "../url/urlMatcherFactory"; import {UrlRouter} from "../url/urlRouter"; import {ViewService} from "../view/view"; -import {UiView} from "./directives/uiView"; +import {UIView} from "./directives/uiView"; import {ng2ViewsBuilder, Ng2ViewConfig} from "./statebuilders/views"; import {Ng2ViewDeclaration} from "./interface"; -import {UiRouterConfig} from "./uiRouterConfig"; +import {UIRouterConfig} from "./uiRouterConfig"; import {Globals} from "../globals"; -import {UiRouterLocation} from "./location"; +import {UIRouterLocation} from "./location"; import {services} from "../common/coreservices"; import {ProviderLike} from "../state/interface"; -let uiRouterFactory = (routerConfig: UiRouterConfig, location: UiRouterLocation, injector: Injector) => { +let uiRouterFactory = (routerConfig: UIRouterConfig, location: UIRouterLocation, injector: Injector) => { services.$injector.get = injector.get.bind(injector); - let router = new UiRouter(); + let router = new UIRouter(); location.init(); @@ -93,32 +93,32 @@ let uiRouterFactory = (routerConfig: UiRouterConfig, location: UiRouterLocation, * @example * ```js * - * bootstrap(UiView, [ + * bootstrap(UIView, [ * ...UIROUTER_PROVIDERS, * ...HTTP_PROVIDERS, - * provide(UiRouterConfig, { useClass: MyUiRouterConfig }) + * provide(UIRouterConfig, { useClass: MyUIRouterConfig }) * ]); * ``` */ export const UIROUTER_PROVIDERS: ProviderLike[] = [ - { provide: UiRouter, useFactory: uiRouterFactory, deps: [UiRouterConfig, UiRouterLocation, Injector] }, + { provide: UIRouter, useFactory: uiRouterFactory, deps: [UIRouterConfig, UIRouterLocation, Injector] }, - { provide: UiRouterLocation, useClass: UiRouterLocation }, + { provide: UIRouterLocation, useClass: UIRouterLocation }, - { provide: StateService, useFactory: (r: UiRouter) => { return r.stateService; }, deps: [UiRouter]}, + { provide: StateService, useFactory: (r: UIRouter) => { return r.stateService; }, deps: [UIRouter]}, - { provide: TransitionService, useFactory: (r: UiRouter) => { return r.transitionService; }, deps: [UiRouter]}, + { provide: TransitionService, useFactory: (r: UIRouter) => { return r.transitionService; }, deps: [UIRouter]}, - { provide: UrlMatcherFactory, useFactory: (r: UiRouter) => { return r.urlMatcherFactory; }, deps: [UiRouter]}, + { provide: UrlMatcherFactory, useFactory: (r: UIRouter) => { return r.urlMatcherFactory; }, deps: [UIRouter]}, - { provide: UrlRouter, useFactory: (r: UiRouter) => { return r.urlRouter; }, deps: [UiRouter]}, + { provide: UrlRouter, useFactory: (r: UIRouter) => { return r.urlRouter; }, deps: [UIRouter]}, - { provide: ViewService, useFactory: (r: UiRouter) => { return r.viewService; }, deps: [UiRouter]}, + { provide: ViewService, useFactory: (r: UIRouter) => { return r.viewService; }, deps: [UIRouter]}, - { provide: StateRegistry, useFactory: (r: UiRouter) => { return r.stateRegistry; }, deps: [UiRouter]}, + { provide: StateRegistry, useFactory: (r: UIRouter) => { return r.stateRegistry; }, deps: [UIRouter]}, - { provide: Globals, useFactory: (r: UiRouter) => { return r.globals; }, deps: [UiRouter]}, + { provide: Globals, useFactory: (r: UIRouter) => { return r.globals; }, deps: [UIRouter]}, - { provide: UiView.PARENT_INJECT, useFactory: (r: StateRegistry) => { return { fqn: null, context: r.root() } }, deps: [StateRegistry]} + { provide: UIView.PARENT_INJECT, useFactory: (r: StateRegistry) => { return { fqn: null, context: r.root() } }, deps: [StateRegistry]} ]; \ No newline at end of file diff --git a/src/ng2/statebuilders/views.ts b/src/ng2/statebuilders/views.ts index 58b133ee3..2499d2215 100644 --- a/src/ng2/statebuilders/views.ts +++ b/src/ng2/statebuilders/views.ts @@ -27,7 +27,7 @@ export function ng2ViewsBuilder(state: State) { config.$context = state; config.$name = name; - let normalized = ViewService.normalizeUiViewTarget(config.$context, config.$name); + let normalized = ViewService.normalizeUIViewTarget(config.$context, config.$name); config.$uiViewName = normalized.uiViewName; config.$uiViewContextAnchor = normalized.uiViewContextAnchor; diff --git a/src/ng2/uiRouterConfig.ts b/src/ng2/uiRouterConfig.ts index 14643d5b4..a659310b3 100644 --- a/src/ng2/uiRouterConfig.ts +++ b/src/ng2/uiRouterConfig.ts @@ -1,5 +1,5 @@ /** @module ng2 */ /** */ -import {UiRouter} from "../router"; +import {UIRouter} from "../router"; /** * Provides states configuration to UI-Router during application bootstrap. * @@ -7,16 +7,16 @@ import {UiRouter} from "../router"; * * @example * ```js - * import {UIROUTER_PROVIDERS, UiView} from "ui-router-ng2"; + * import {UIROUTER_PROVIDERS, UIView} from "ui-router-ng2"; * import {MyConfig} from "./app/myConfig"; * - * bootstrap(UiView, [ + * bootstrap(UIView, [ * ...UIROUTER_PROVIDERS, - * provide(UiRouterConfig, { useClass: MyConfig } + * provide(UIRouterConfig, { useClass: MyConfig } * ]); * ``` * - * The application's initial states should be registered with the [[UiRouter.stateRegistry]]. + * The application's initial states should be registered with the [[UIRouter.stateRegistry]]. * Any global configuration (transition hooks, parameter types, etc) should be done here. * * @example @@ -28,7 +28,7 @@ import {UiRouter} from "../router"; * import {registerSlugType} from "./paramtypes"; * * export class MyConfig { - * configure(uiRouter: UiRouter) { + * configure(uiRouter: UIRouter) { * STATES.forEach(state => uiRouter.stateRegistry.register(state)); * registerAuthHook(uiRouter.transitionService); * registerSlugType(uiRouter.urlMatcherFactory); @@ -65,7 +65,7 @@ import {UiRouter} from "../router"; * ``` * */ -export class UiRouterConfig { +export class UIRouterConfig { /** * Configures UI-Router before bootstrap * @@ -74,7 +74,7 @@ export class UiRouterConfig { * * @param uiRouter the uiRouter instance being configured */ - public configure(uiRouter: UiRouter) { + public configure(uiRouter: UIRouter) { } } \ No newline at end of file diff --git a/src/resolve/resolveContext.ts b/src/resolve/resolveContext.ts index 405ddfc16..012477c89 100644 --- a/src/resolve/resolveContext.ts +++ b/src/resolve/resolveContext.ts @@ -11,7 +11,7 @@ import {State} from "../state/stateObject"; import {PathFactory} from "../path/pathFactory"; import {stringify} from "../common/strings"; import {Transition} from "../transition/transition"; -import {UiInjector} from "../common/interface"; +import {UIInjector} from "../common/interface"; var when = resolvePolicies.when; const ALL_WHENS = [when.EAGER, when.LAZY]; @@ -130,8 +130,8 @@ export class ResolveContext { return services.$q.all(promises); } - injector(): UiInjector { - return new UiInjectorImpl(this); + injector(): UIInjector { + return new UIInjectorImpl(this); } findNode(resolvable: Resolvable): PathNode { @@ -168,7 +168,7 @@ export class ResolveContext { } } -class UiInjectorImpl implements UiInjector { +class UIInjectorImpl implements UIInjector { constructor(public context: ResolveContext) { } get(token: any) { var resolvable = this.context.getResolvable(token); diff --git a/src/router.ts b/src/router.ts index 1b509b8b2..cd27f4f8e 100644 --- a/src/router.ts +++ b/src/router.ts @@ -7,7 +7,7 @@ import {TransitionService} from "./transition/transitionService"; import {ViewService} from "./view/view"; import {StateRegistry} from "./state/stateRegistry"; import {StateService} from "./state/stateService"; -import {UiRouterGlobals, Globals} from "./globals"; +import {UIRouterGlobals, Globals} from "./globals"; /** * The master class used to instantiate an instance of UI-Router. @@ -18,12 +18,12 @@ import {UiRouterGlobals, Globals} from "./globals"; * your app states with the [[stateRegistry]] (and set url options using ...). Then, tell UI-Router to monitor * the URL by calling `urlRouter.listen()` ([[URLRouter.listen]]) */ -export class UiRouter { +export class UIRouter { viewService = new ViewService(); transitionService: TransitionService = new TransitionService(this); - globals: UiRouterGlobals = new Globals(this.transitionService); + globals: UIRouterGlobals = new Globals(this.transitionService); urlMatcherFactory: UrlMatcherFactory = new UrlMatcherFactory(); diff --git a/src/state/interface.ts b/src/state/interface.ts index 8f0c5bb77..c10776cb3 100644 --- a/src/state/interface.ts +++ b/src/state/interface.ts @@ -8,7 +8,7 @@ import {Transition} from "../transition/transition"; import {TransitionStateHookFn} from "../transition/interface"; import {ResolvePolicy, ResolvableLiteral} from "../resolve/interface"; import {Resolvable} from "../resolve/resolvable"; -import {UiInjector} from "../common/interface"; +import {UIInjector} from "../common/interface"; import {TargetState} from "./targetState"; export type StateOrName = (string|StateDeclaration|State); diff --git a/src/state/stateService.ts b/src/state/stateService.ts index 6e090c595..eff93b0ca 100644 --- a/src/state/stateService.ts +++ b/src/state/stateService.ts @@ -24,7 +24,7 @@ import {equalForKeys} from "../common/common"; import {HrefOptions} from "./interface"; import {bindFunctions} from "../common/common"; import {Globals} from "../globals"; -import {UiRouter} from "../router"; +import {UIRouter} from "../router"; import {StateParams} from "../params/stateParams"; // for params() return type export class StateService { @@ -33,7 +33,7 @@ export class StateService { get current() { return this.router.globals.current; } get $current() { return this.router.globals.$current; } - constructor(private router: UiRouter) { + constructor(private router: UIRouter) { let getters = ['current', '$current', 'params', 'transition']; let boundFns = Object.keys(StateService.prototype).filter(key => getters.indexOf(key) === -1); bindFunctions(StateService.prototype, this, this, boundFns); diff --git a/src/transition/interface.ts b/src/transition/interface.ts index 8a9a5211a..85462e70d 100644 --- a/src/transition/interface.ts +++ b/src/transition/interface.ts @@ -6,7 +6,7 @@ import {Transition} from "./transition"; import {State} from "../state/stateObject"; import {PathNode} from "../path/node"; import {TargetState} from "../state/targetState"; -import {UiInjector} from "../common/interface"; +import {UIInjector} from "../common/interface"; /** * The TransitionOptions object can be used to change the behavior of a transition. diff --git a/src/transition/transition.ts b/src/transition/transition.ts index d4948a821..d0134ed35 100644 --- a/src/transition/transition.ts +++ b/src/transition/transition.ts @@ -26,9 +26,9 @@ import {Resolvable} from "../resolve/resolvable"; import {ViewConfig} from "../view/interface"; import {Rejection} from "./rejectFactory"; import {ResolveContext} from "../resolve/resolveContext"; -import {UiRouter} from "../router"; +import {UIRouter} from "../router"; import {Globals} from "../globals"; -import {UiInjector} from "../common/interface"; +import {UIInjector} from "../common/interface"; let transitionCount = 0; @@ -49,11 +49,11 @@ export class Transition implements IHookRegistry { success: boolean; /** - * A reference to the [[UiRouter]] instance + * A reference to the [[UIRouter]] instance * * This reference can be used to access the router services, such as the [[StateService]] */ - router: UiRouter; + router: UIRouter; /** @hidden */ private _deferred = services.$q.defer(); @@ -95,9 +95,9 @@ export class Transition implements IHookRegistry { * @param fromPath The path of [[PathNode]]s from which the transition is leaving. The last node in the `fromPath` * encapsulates the "from state". * @param targetState The target state and parameters being transitioned to (also, the transition options) - * @param router The [[UiRouter]] instance + * @param router The [[UIRouter]] instance */ - constructor(fromPath: PathNode[], targetState: TargetState, router: UiRouter) { + constructor(fromPath: PathNode[], targetState: TargetState, router: UIRouter) { this.router = router; if (!targetState.valid()) { throw new Error(targetState.error()); @@ -115,7 +115,7 @@ export class Transition implements IHookRegistry { PathFactory.applyViewConfigs(router.transitionService.$view, this._treeChanges.to, enteringStates); let rootResolvables: Resolvable[] = [ - new Resolvable(UiRouter, () => router, [], undefined, router), + new Resolvable(UIRouter, () => router, [], undefined, router), new Resolvable(Transition, () => this, [], undefined, this), new Resolvable('$transition$', () => this, [], undefined, this), new Resolvable('$stateParams', () => this.params(), [], undefined, this.params()) @@ -179,19 +179,19 @@ export class Transition implements IHookRegistry { /** - * Creates a [[UiInjector]] Dependency Injector + * Creates a [[UIInjector]] Dependency Injector * * Returns a Dependency Injector for the Transition's target state (to state). * The injector provides resolve values which the target state has access to. * - * The `UiInjector` can also provide values from the native root/global injector (ng1/ng2). + * The `UIInjector` can also provide values from the native root/global injector (ng1/ng2). * * If a `state` is provided, the injector that is returned will be limited to resolve values that the provided state has access to. * * @param state Limits the resolves provided to only the resolves the provided state has access to. - * @returns a [[UiInjector]] + * @returns a [[UIInjector]] */ - injector(state?: StateOrName): UiInjector { + injector(state?: StateOrName): UIInjector { let path: PathNode[] = this.treeChanges().to; if (state) path = PathFactory.subPath(path, node => node.state === state || node.state.name === state); return new ResolveContext(path).injector(); diff --git a/src/transition/transitionService.ts b/src/transition/transitionService.ts index 77555bd10..6ce179ec2 100644 --- a/src/transition/transitionService.ts +++ b/src/transition/transitionService.ts @@ -15,7 +15,7 @@ import {loadEnteringViews, activateViews} from "../hooks/views"; import {updateUrl} from "../hooks/url"; import {redirectToHook} from "../hooks/redirectTo"; import {onExitHook, onRetainHook, onEnterHook} from "../hooks/onEnterExitRetain"; -import {UiRouter} from "../router"; +import {UIRouter} from "../router"; import {val} from "../common/hof"; /** @@ -42,7 +42,7 @@ export let defaultTransOpts: TransitionOptions = { * - It allows the default transition error handler to be set. * - It also has a factory function for creating new [[Transition]] objects, (used internally by the [[StateService]]). * - * At bootstrap, [[UiRouter]] creates a single instance (singleton) of this class. + * At bootstrap, [[UIRouter]] creates a single instance (singleton) of this class. */ export class TransitionService implements IHookRegistry { /** @hidden */ @@ -66,7 +66,7 @@ export class TransitionService implements IHookRegistry { redirectTo: Function; }; - constructor(private _router: UiRouter) { + constructor(private _router: UIRouter) { this.$view = _router.viewService; HookRegistry.mixin(new HookRegistry(), this); this._deregisterHookFns = {}; diff --git a/src/url/urlMatcherConfig.ts b/src/url/urlMatcherConfig.ts index 8f99497ce..d6dec34cb 100644 --- a/src/url/urlMatcherConfig.ts +++ b/src/url/urlMatcherConfig.ts @@ -21,5 +21,5 @@ export class MatcherConfig { } } -// TODO: Do not export global instance; create one in UiRouter() constructor +// TODO: Do not export global instance; create one in UIRouter() constructor export let matcherConfig = new MatcherConfig(); diff --git a/src/view/interface.ts b/src/view/interface.ts index 142c7abc2..2b7170fe2 100644 --- a/src/view/interface.ts +++ b/src/view/interface.ts @@ -11,7 +11,7 @@ export interface ViewContext { } /** @hidden */ -export interface ActiveUiView { +export interface ActiveUIView { /** type of framework, e.g., "ng1" or "ng2" */ $type: string; /** An auto-incremented id */ diff --git a/src/view/view.ts b/src/view/view.ts index 9169da4fd..6b83b0c9e 100644 --- a/src/view/view.ts +++ b/src/view/view.ts @@ -5,7 +5,7 @@ import {isString, isArray} from "../common/predicates"; import {trace} from "../common/trace"; import {PathNode} from "../path/node"; -import {ActiveUiView, ViewContext, ViewConfig} from "./interface"; +import {ActiveUIView, ViewContext, ViewConfig} from "./interface"; import {_ViewDeclaration} from "../state/interface"; const match = (obj1, ...keys) => @@ -17,7 +17,7 @@ export type ViewConfigFactory = (path: PathNode[], decl: _ViewDeclaration) => Vi * The View service */ export class ViewService { - private uiViews: ActiveUiView[] = []; + private uiViews: ActiveUIView[] = []; private viewConfigs: ViewConfig[] = []; private _rootContext; private _viewConfigFactories: { [key: string]: ViewConfigFactory } = {}; @@ -55,7 +55,7 @@ export class ViewService { }; sync = () => { - let uiViewsByFqn: TypedMap = + let uiViewsByFqn: TypedMap = this.uiViews.map(uiv => [uiv.fqn, uiv]).reduce(applyPairs, {}); /** @@ -113,7 +113,7 @@ export class ViewService { * - And the remaining segments [ "$default", "bar" ].join("."_ of the ViewConfig's target name match * the tail of the ui-view's fqn "default.bar" */ - const matches = (uiView: ActiveUiView) => (viewConfig: ViewConfig) => { + const matches = (uiView: ActiveUIView) => (viewConfig: ViewConfig) => { // Don't supply an ng1 ui-view with an ng2 ViewConfig, etc if (uiView.$type !== viewConfig.viewDecl.$type) return false; @@ -136,7 +136,7 @@ export class ViewService { }; // Return the number of dots in the fully qualified name - function uiViewDepth(uiView: ActiveUiView) { + function uiViewDepth(uiView: ActiveUIView) { return uiView.fqn.split(".").length; } @@ -157,14 +157,14 @@ export class ViewService { return [uiView, matchingConfigs[0]]; }; - const configureUiView = ([uiView, viewConfig]) => { + const configureUIView = ([uiView, viewConfig]) => { // If a parent ui-view is reconfigured, it could destroy child ui-views. // Before configuring a child ui-view, make sure it's still in the active uiViews array. if (this.uiViews.indexOf(uiView) !== -1) uiView.configUpdated(viewConfig); }; - this.uiViews.sort(depthCompare(uiViewDepth, 1)).map(matchingConfigPair).forEach(configureUiView); + this.uiViews.sort(depthCompare(uiViewDepth, 1)).map(matchingConfigPair).forEach(configureUIView); }; /** @@ -176,12 +176,12 @@ export class ViewService { * of the view. * @return {Function} Returns a de-registration function used when the view is destroyed. */ - registerUiView(uiView: ActiveUiView) { - trace.traceViewServiceUiViewEvent("-> Registering", uiView); + registerUIView(uiView: ActiveUIView) { + trace.traceViewServiceUIViewEvent("-> Registering", uiView); let uiViews = this.uiViews; const fqnMatches = uiv => uiv.fqn === uiView.fqn; if (uiViews.filter(fqnMatches).length) - trace.traceViewServiceUiViewEvent("!!!! duplicate uiView named:", uiView); + trace.traceViewServiceUIViewEvent("!!!! duplicate uiView named:", uiView); uiViews.push(uiView); this.sync(); @@ -189,10 +189,10 @@ export class ViewService { return () => { let idx = uiViews.indexOf(uiView); if (idx <= 0) { - trace.traceViewServiceUiViewEvent("Tried removing non-registered uiView", uiView); + trace.traceViewServiceUIViewEvent("Tried removing non-registered uiView", uiView); return; } - trace.traceViewServiceUiViewEvent("<- Deregistering", uiView); + trace.traceViewServiceUIViewEvent("<- Deregistering", uiView); removeFrom(uiViews)(uiView); }; }; @@ -223,7 +223,7 @@ export class ViewService { * * @returns the normalized uiViewName and uiViewContextAnchor that the view targets */ - static normalizeUiViewTarget(context: ViewContext, rawViewName = "") { + static normalizeUIViewTarget(context: ViewContext, rawViewName = "") { // TODO: Validate incoming view name with a regexp to allow: // ex: "view.name@foo.bar" , "^.^.view.name" , "view.name@^.^" , "" , // "@" , "$default@^" , "!$default.$default" , "!foo.bar" diff --git a/test/core/hookBuilderSpec.ts b/test/core/hookBuilderSpec.ts index 9a48ecbdf..72c6bc141 100644 --- a/test/core/hookBuilderSpec.ts +++ b/test/core/hookBuilderSpec.ts @@ -1,12 +1,12 @@ import { - UiRouter, TransitionService, StateService, State, PathNode, tail, PathFactory + UIRouter, TransitionService, StateService, State, PathNode, tail, PathFactory } from "../../src/core"; import {tree2Array} from "../stateHelper.ts"; import "../../src/justjs"; describe('HookBuilder:', function() { - let uiRouter: UiRouter = null; + let uiRouter: UIRouter = null; let $trans: TransitionService = null; let $state: StateService = null; let root: State = null; @@ -17,7 +17,7 @@ describe('HookBuilder:', function() { beforeEach(() => { log = ""; - uiRouter = new UiRouter(); + uiRouter = new UIRouter(); $trans = uiRouter.transitionService; $state = uiRouter.stateService; root = uiRouter.stateRegistry.root(); @@ -40,7 +40,7 @@ describe('HookBuilder:', function() { let trans, trans2, hb, hb2, callback; beforeEach(function() { - // Clean out the default UiRouter onBefore hooks + // Clean out the default UIRouter onBefore hooks uiRouter.transitionService.getHooks("onBefore").length = 0; // Transition from 'A' to 'A.B.C' diff --git a/test/core/hooksSpec.ts b/test/core/hooksSpec.ts index 7a29bbc46..33bb93884 100644 --- a/test/core/hooksSpec.ts +++ b/test/core/hooksSpec.ts @@ -1,5 +1,5 @@ -import {UiRouter} from "../../src/router"; +import {UIRouter} from "../../src/router"; import {tree2Array} from "../stateHelper.ts"; import {find} from "../../src/common/common"; @@ -17,7 +17,7 @@ let statetree = { describe("hooks", () => { let router, $state, states, init; beforeEach(() => { - router = new UiRouter(); + router = new UIRouter(); $state = router.stateService; states = tree2Array(statetree, false); init = () => { diff --git a/test/ng1/transitionSpec.ts b/test/ng1/transitionSpec.ts index 30368d4c4..52c637ebd 100644 --- a/test/ng1/transitionSpec.ts +++ b/test/ng1/transitionSpec.ts @@ -1,6 +1,6 @@ import {PathNode} from "../../src/path/node"; var module = angular.mock.module; -import { UiRouter } from "../../src/core"; +import { UIRouter } from "../../src/core"; import { RejectType, Rejection } from "../../src/transition/rejectFactory"; import { extend, forEach, map, omit, pick, pluck } from "../../src/common/common"; import {PathFactory} from "../../src/path/pathFactory";