From 002e8d1531a71d18840af982f63f7b8927697f14 Mon Sep 17 00:00:00 2001 From: christopherthielen Date: Mon, 8 Feb 2016 17:15:01 -0600 Subject: [PATCH] refactor(common): simplify references to angular.* functions refactor(*): for typescript 1.8: export all interfaces/classes/enums exposed externally refactor(*): for typescript 1.8: switch up /// window).angular; -export const fromJson = angular && angular.fromJson || _fromJson; -export const toJson = angular && angular.toJson || _toJson; -export const copy = angular && angular.copy || _copy; -export const forEach = angular && angular.forEach || _forEach; -export const extend = angular && angular.extend || _extend; -export const equals = angular && angular.equals || _equals; +let angular = ( window).angular || {}; +export const fromJson = angular.fromJson || _fromJson; +export const toJson = angular.toJson || _toJson; +export const copy = angular.copy || _copy; +export const forEach = angular.forEach || _forEach; +export const extend = angular.extend || _extend; +export const equals = angular.equals || _equals; export const identity = (x) => x; export const noop = () => undefined; -type Mapper = (x: X, key?: (string|number)) => T; +export type Mapper = (x: X, key?: (string|number)) => T; export interface TypedMap { [key: string]: T; } export type Predicate = (X) => boolean; export type IInjectable = (Function|any[]); @@ -570,3 +570,9 @@ function _arraysEq(a1, a2) { if (a1.length !== a2.length) return false; return arrayTuples(a1, a2).reduce((b, t) => b && _equals(t[0], t[1]), true); } +// +//const _addToGroup = (result, keyFn) => (item) => +// (result[keyFn(item)] = result[keyFn(item)] || []).push(item) && result; +//const groupBy = (array, keyFn) => array.reduce((memo, item) => _addToGroup(memo, keyFn), {}); +// +// diff --git a/src/common/coreservices.ts b/src/common/coreservices.ts index 31a986fc6..3831cbd18 100644 --- a/src/common/coreservices.ts +++ b/src/common/coreservices.ts @@ -27,7 +27,7 @@ let services: CoreServices = { ["port", "protocol", "host", "baseHref", "html5Mode", "hashPrefix" ] .forEach(key => services.locationConfig[key] = notImplemented(key)); -interface CoreServices { +export interface CoreServices { $q; // : IQService; $injector; // : IInjectorService; /** Services related to getting or setting the browser location (url) */ @@ -37,7 +37,7 @@ interface CoreServices { template: TemplateServices; } -interface LocationServices { +export interface LocationServices { replace(): void; url(newurl: string): string; url(): string; @@ -47,7 +47,7 @@ interface LocationServices { onChange(callback: Function): Function; } -interface LocationConfig { +export interface LocationConfig { port(): number; protocol(): string; host(): string; @@ -58,7 +58,7 @@ interface LocationConfig { hashPrefix(newprefix: string): string; } -interface TemplateServices { +export interface TemplateServices { get(url: string): string; } diff --git a/src/common/trace.ts b/src/common/trace.ts index d219e980f..8237d6059 100644 --- a/src/common/trace.ts +++ b/src/common/trace.ts @@ -43,11 +43,11 @@ function stringify(o) { return JSON.stringify(o, (key, val) => format(val)).replace(/\\"/g, '"'); } -enum Category { +export enum Category { RESOLVE, TRANSITION, HOOK, INVOKE, UIVIEW, VIEWCONFIG } -class Trace { +export class Trace { approximateDigests: number; constructor() { diff --git a/src/ng1.ts b/src/ng1.ts index 26b0e4433..970b2c92a 100644 --- a/src/ng1.ts +++ b/src/ng1.ts @@ -1,3 +1,5 @@ +/// +/// /** * Main entry point for angular 1.x build */ diff --git a/src/ng1/services.ts b/src/ng1/services.ts index c8b369b58..285529e43 100644 --- a/src/ng1/services.ts +++ b/src/ng1/services.ts @@ -9,9 +9,11 @@ * @preferred */ -/** for typedoc */ /// -import {Router} from "../router"; +/// + +/** for typedoc */ +import {UIRouter} from "../router"; import {services} from "../common/coreservices"; import {map, bindFunctions, removeFrom, find, noop} from "../common/common"; import {prop, propEq} from "../common/hof"; @@ -148,14 +150,14 @@ function runBlock($injector, $q) { app.run(runBlock); -let router: Router = null; +let router: UIRouter = null; ng1UIRouter.$inject = ['$locationProvider']; /** This angular 1 provider instantiates a Router and exposes its services via the angular injector */ function ng1UIRouter($locationProvider) { // Create a new instance of the Router when the ng1UIRouterProvider is initialized - router = new Router(); + router = new UIRouter(); // Bind LocationConfig.hashPrefix to $locationProvider.hashPrefix bindFunctions($locationProvider, services.locationConfig, $locationProvider, ['hashPrefix']); diff --git a/src/ng1/stateEvents.ts b/src/ng1/stateEvents.ts index 0703a319a..55a7f7d91 100644 --- a/src/ng1/stateEvents.ts +++ b/src/ng1/stateEvents.ts @@ -18,8 +18,6 @@ */ /** for typedoc */ -/// - import {IServiceProviderFactory} from "angular"; import {StateService, StateProvider} from "../state/interface"; import {TargetState} from "../state/module"; diff --git a/src/ng1/stateFilters.ts b/src/ng1/stateFilters.ts index 7609ac466..2682673c1 100644 --- a/src/ng1/stateFilters.ts +++ b/src/ng1/stateFilters.ts @@ -1,5 +1,4 @@ /** @module state */ /** for typedoc */ -/// /** * @ngdoc filter diff --git a/src/ng1/viewDirective.ts b/src/ng1/viewDirective.ts index 64255c79f..47bff217f 100644 --- a/src/ng1/viewDirective.ts +++ b/src/ng1/viewDirective.ts @@ -1,8 +1,6 @@ var ngMajorVer = angular.version.major; var ngMinorVer = angular.version.minor; /** @module view */ /** for typedoc */ -/// - import {extend} from "../common/common"; import {isDefined} from "../common/predicates"; import {trace} from "../common/trace"; diff --git a/src/ng1/viewScroll.ts b/src/ng1/viewScroll.ts index f7f1f97fd..469e82158 100644 --- a/src/ng1/viewScroll.ts +++ b/src/ng1/viewScroll.ts @@ -1,5 +1,4 @@ /** @module view */ /** for typedoc */ -/// import {IServiceProviderFactory} from "angular"; /** diff --git a/src/params/interface.ts b/src/params/interface.ts index b0df728c7..c7bde823f 100644 --- a/src/params/interface.ts +++ b/src/params/interface.ts @@ -214,7 +214,7 @@ export interface ParamDeclaration { dynamic: boolean; } -interface Replace { +export interface Replace { from: string; to: string; } diff --git a/src/params/paramTypes.ts b/src/params/paramTypes.ts index 7cf21ac82..a44609918 100644 --- a/src/params/paramTypes.ts +++ b/src/params/paramTypes.ts @@ -12,7 +12,7 @@ import {Type} from "./type"; function valToString(val) { return val != null ? val.toString().replace(/~/g, "~~").replace(/\//g, "~2F") : val; } function valFromString(val) { return val != null ? val.toString().replace(/~2F/g, "/").replace(/~~/g, "~") : val; } -class ParamTypes { +export class ParamTypes { types: any; enqueue: boolean = true; typeQueue: any[] = []; diff --git a/src/resolve/resolvable.ts b/src/resolve/resolvable.ts index b03e74d06..680097c13 100644 --- a/src/resolve/resolvable.ts +++ b/src/resolve/resolvable.ts @@ -1,12 +1,10 @@ /** @module path */ /** for typedoc */ -/// import {extend, pick, map, filter} from "../common/common"; import {not} from "../common/hof"; import {isInjectable} from "../common/predicates"; import {services} from "../common/coreservices"; import {trace} from "../common/trace"; -import {IPromise} from "angular"; import {Resolvables, IOptions1} from "./interface"; import {ResolveContext} from "./resolveContext"; @@ -32,7 +30,7 @@ export class Resolvable { resolveFn: Function; deps: string[]; - promise: IPromise = undefined; + promise: Promise = undefined; data: any; // synchronous part: @@ -80,7 +78,7 @@ export class Resolvable { }); } - get(resolveContext: ResolveContext, options?: IOptions1): IPromise { + get(resolveContext: ResolveContext, options?: IOptions1): Promise { return this.promise || this.resolveResolvable(resolveContext, options); } diff --git a/src/resolve/resolveContext.ts b/src/resolve/resolveContext.ts index 4c6a47635..be137c7da 100644 --- a/src/resolve/resolveContext.ts +++ b/src/resolve/resolveContext.ts @@ -1,11 +1,9 @@ /** @module path */ /** for typedoc */ -/// import {IInjectable, find, filter, map, tail, defaults, extend, pick, omit} from "../common/common"; import {prop, propEq} from "../common/hof"; import {isString, isObject} from "../common/predicates"; import {trace} from "../common/trace"; import {services} from "../common/coreservices"; -import {IPromise} from "angular"; import {Resolvables, ResolvePolicy, IOptions1} from "./interface"; import {Node} from "../path/module"; @@ -17,7 +15,7 @@ import {mergeR} from "../common/common"; let defaultResolvePolicy = ResolvePolicy[ResolvePolicy.LAZY]; interface IPolicies { [key: string]: string; } -interface IPromises { [key: string]: IPromise; } +interface Promises { [key: string]: Promise; } export class ResolveContext { @@ -93,7 +91,7 @@ export class ResolveContext { } // Returns a promise for an array of resolved path Element promises - resolvePath(options: IOptions1 = {}): IPromise { + resolvePath(options: IOptions1 = {}): Promise { trace.traceResolvePath(this._path, options); const promiseForNode = (node: Node) => this.resolvePathElement(node.state, options); return services.$q.all( map(this._path, promiseForNode)).then(all => all.reduce(mergeR, {})); @@ -103,7 +101,7 @@ export class ResolveContext { // options.resolvePolicy: only return promises for those Resolvables which are at // the specified policy, or above. i.e., options.resolvePolicy === 'lazy' will // resolve both 'lazy' and 'eager' resolves. - resolvePathElement(state: State, options: IOptions1 = {}): IPromise { + resolvePathElement(state: State, options: IOptions1 = {}): Promise { // The caller can request the path be resolved for a given policy and "below" let policy: string = options && options.resolvePolicy; let policyOrdinal: number = ResolvePolicy[policy || defaultResolvePolicy]; @@ -114,7 +112,7 @@ export class ResolveContext { let matchingResolves = filter(resolvables, matchesRequestedPolicy); const getResolvePromise = (resolvable: Resolvable) => resolvable.get(this.isolateRootTo(state), options); - let resolvablePromises: IPromises = map(matchingResolves, getResolvePromise); + let resolvablePromises: Promises = map(matchingResolves, getResolvePromise); trace.traceResolvePathElement(this, matchingResolves, options); @@ -135,11 +133,11 @@ export class ResolveContext { * @param locals: are the angular $injector-style locals to inject * @param options: options (TODO: document) */ - invokeLater(fn: IInjectable, locals: any = {}, options: IOptions1 = {}): IPromise { + invokeLater(fn: IInjectable, locals: any = {}, options: IOptions1 = {}): Promise { let resolvables = this.getResolvablesForFn(fn); trace.tracePathElementInvoke(tail(this._path), fn, Object.keys(resolvables), extend({when: "Later"}, options)); const getPromise = (resolvable: Resolvable) => resolvable.get(this, options); - let promises: IPromises = map(resolvables, getPromise); + let promises: Promises = map(resolvables, getPromise); return services.$q.all(promises).then(() => { try { diff --git a/src/resolve/resolveInjector.ts b/src/resolve/resolveInjector.ts index d00bad6b8..b04bf7fad 100644 --- a/src/resolve/resolveInjector.ts +++ b/src/resolve/resolveInjector.ts @@ -4,6 +4,7 @@ import {map} from "../common/common"; import {Resolvable} from "./resolvable"; import {ResolveContext} from "./resolveContext"; import {State} from "../state/module"; +import {TypedMap} from "../common/common"; export class ResolveInjector { constructor(private _resolveContext: ResolveContext, private _state: State) { } diff --git a/src/router.ts b/src/router.ts index 183796712..2016a74cc 100644 --- a/src/router.ts +++ b/src/router.ts @@ -2,6 +2,7 @@ import {UrlMatcherFactory} from "./url/urlMatcherFactory"; import {UrlRouterProvider} from "./url/urlRouter"; import {StateProvider} from "./state/state"; import {stateParamsFactory} from "./params/stateParams"; +import {StateParams} from "./params/stateParams"; import {UrlRouter} from "./url/urlRouter"; import {TransitionService} from "./transition/transitionService"; import {TemplateFactory} from "./view/templateFactory"; @@ -18,7 +19,7 @@ import {StateService} from "./state/stateService"; * 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]]) */ -class Router { +class UIRouter { stateParams = stateParamsFactory(); @@ -46,4 +47,4 @@ class Router { } } -export { Router }; \ No newline at end of file +export { UIRouter }; \ No newline at end of file diff --git a/src/state/hooks/resolveHooks.ts b/src/state/hooks/resolveHooks.ts index 8ba57de4a..12e57a519 100644 --- a/src/state/hooks/resolveHooks.ts +++ b/src/state/hooks/resolveHooks.ts @@ -24,13 +24,13 @@ export class ResolveHooks { let treeChanges = this.transition.treeChanges(); /** a function which resolves any EAGER Resolvables for a Path */ - $eagerResolvePath.$inject = ['$transition$']; + ( $eagerResolvePath).$inject = ['$transition$']; function $eagerResolvePath($transition$) { return tail( treeChanges.to).resolveContext.resolvePath(extend({ transition: $transition$ }, { resolvePolicy: EAGER })); } /** Returns a function which pre-resolves any LAZY Resolvables for a Node in a Path */ - $lazyResolveEnteringState.$inject = ['$state$', '$transition$']; + ( $lazyResolveEnteringState).$inject = ['$state$', '$transition$']; function $lazyResolveEnteringState($state$, $transition$) { let node = find( treeChanges.entering, propEq('state', $state$)); return node.resolveContext.resolvePathElement(node.state, extend({transition: $transition$}, { resolvePolicy: LAZY })); diff --git a/src/state/hooks/transitionManager.ts b/src/state/hooks/transitionManager.ts index 0ead617ad..32ec64962 100644 --- a/src/state/hooks/transitionManager.ts +++ b/src/state/hooks/transitionManager.ts @@ -1,5 +1,4 @@ /** @module state */ /** for typedoc */ -import {IPromise, IQService} from "angular"; import {copy} from "../../common/common"; import {prop} from "../../common/hof"; import {Queue} from "../../common/queue"; @@ -45,7 +44,7 @@ export class TransitionManager { private $view, // service private $state: StateService, private $stateParams, // service/obj - private $q: IQService, // TODO: get from runtime.$q + private $q, // TODO: get from runtime.$q private activeTransQ: Queue, private changeHistory: Queue ) { @@ -61,7 +60,7 @@ export class TransitionManager { this.resolveHooks.registerHooks(); } - runTransition(): IPromise { + runTransition(): Promise { this.activeTransQ.clear(); // TODO: nuke this this.activeTransQ.enqueue(this.transition); this.$state.transition = this.transition; @@ -92,7 +91,7 @@ export class TransitionManager { this.updateStateParams(); } - transRejected(error): (StateDeclaration|IPromise) { + transRejected(error): (StateDeclaration|Promise) { let {transition, $state, $stateParams, $q} = this; // Handle redirect and abort if (error instanceof TransitionRejection) { diff --git a/src/state/hooks/viewHooks.ts b/src/state/hooks/viewHooks.ts index db899fcbe..f3203fec1 100644 --- a/src/state/hooks/viewHooks.ts +++ b/src/state/hooks/viewHooks.ts @@ -1,5 +1,4 @@ /** @module state */ /** for typedoc */ -import {IPromise} from "angular"; import {find, noop} from "../../common/common"; import {propEq} from "../../common/hof"; import {services} from "../../common/coreservices"; @@ -15,7 +14,7 @@ export class ViewHooks { private enteringViews: ViewConfig[]; private exitingViews: ViewConfig[]; private transition: Transition; - private $view; // service + private $view: ViewService; // service constructor(transition: Transition, $view: ViewService) { this.transition = transition; @@ -29,7 +28,7 @@ export class ViewHooks { loadAllEnteringViews() { const loadView = (vc: ViewConfig) => { let resolveInjector = find(this.treeChanges.to, propEq('state', vc.context)).resolveInjector; - return > this.$view.load(vc, resolveInjector); + return > this.$view.load(vc, resolveInjector); }; return services.$q.all(this.enteringViews.map(loadView)).then(noop); } diff --git a/src/state/interface.ts b/src/state/interface.ts index f38ebd772..d2c81a3e1 100644 --- a/src/state/interface.ts +++ b/src/state/interface.ts @@ -1,6 +1,4 @@ /** @module state */ /** for typedoc */ -import {IPromise} from "angular"; - import {TransitionOptions} from "../transition/interface"; import {ParamDeclaration, RawParams, ParamsOrArray} from "../params/interface"; @@ -417,10 +415,10 @@ export interface StateService { current: StateDeclaration; $current: State; transition: Transition; - reload (stateOrName: StateOrName): IPromise; + reload (stateOrName: StateOrName): Promise; target (identifier: StateOrName, params: ParamsOrArray, options: TransitionOptions): TargetState; - go (to: StateOrName, params: RawParams, options: TransitionOptions): IPromise; - transitionTo (to: StateOrName, toParams: ParamsOrArray, options: TransitionOptions): IPromise; + go (to: StateOrName, params: RawParams, options: TransitionOptions): Promise; + transitionTo (to: StateOrName, toParams: ParamsOrArray, options: TransitionOptions): Promise; is (stateOrName: StateOrName, params?: RawParams, options?: TransitionOptions): boolean; includes (stateOrName: StateOrName, params?: RawParams, options?: TransitionOptions): boolean; href (stateOrName: StateOrName, params?: RawParams, options?: HrefOptions): string; diff --git a/src/state/state.ts b/src/state/state.ts index e794f1a17..4f2b24f24 100644 --- a/src/state/state.ts +++ b/src/state/state.ts @@ -3,6 +3,7 @@ import {isObject} from "../common/predicates"; import {bindFunctions} from "../common/common"; import {BuilderFunction} from "./module"; import {StateRegistry} from "./stateRegistry"; +import {State} from "./stateObject"; /** * @ngdoc object diff --git a/src/state/stateService.ts b/src/state/stateService.ts index 1f6b9a575..6ba9173f4 100644 --- a/src/state/stateService.ts +++ b/src/state/stateService.ts @@ -2,7 +2,6 @@ import {extend, defaults } from "../common/common"; import {isDefined, isObject, isString} from "../common/predicates"; import {Queue} from "../common/queue"; import {services} from "../common/coreservices"; -import {IPromise} from "angular"; import {PathFactory} from "../path/pathFactory"; import {Node} from "../path/node"; @@ -145,7 +144,7 @@ export class StateService { * @returns {promise} A promise representing the state of the new transition. See * {@link ui.router.state.$state#methods_go $state.go}. */ - reload(reloadState: StateOrName): IPromise { + reload(reloadState: StateOrName): Promise { return this.transitionTo(this.current, this.$stateParams, { reload: isDefined(reloadState) ? reloadState : true, inherit: false, @@ -219,7 +218,7 @@ export class StateService { * - *resolve error* - when an error has occurred with a `resolve` * */ - go(to: StateOrName, params: RawParams, options: TransitionOptions): IPromise { + go(to: StateOrName, params: RawParams, options: TransitionOptions): Promise { let defautGoOpts = { relative: this.$current, inherit: true }; let transOpts = defaults(options, defautGoOpts, defaultTransOpts); return this.transitionTo(to, params, transOpts); @@ -269,7 +268,7 @@ export class StateService { * @returns {promise} A promise representing the state of the new transition. See * {@link ui.router.state.$state#methods_go $state.go}. */ - transitionTo(to: StateOrName, toParams: RawParams = {}, options: TransitionOptions = {}): IPromise { + transitionTo(to: StateOrName, toParams: RawParams = {}, options: TransitionOptions = {}): Promise { let {transQueue, treeChangesQueue} = this; options = defaults(options, defaultTransOpts); options = extend(options, { current: transQueue.peekTail.bind(transQueue)}); diff --git a/src/transition/transition.ts b/src/transition/transition.ts index 46a86b17e..91510240d 100644 --- a/src/transition/transition.ts +++ b/src/transition/transition.ts @@ -1,6 +1,4 @@ /** @module transition */ /** for typedoc */ -/// -import {IPromise} from "angular"; import {trace} from "../common/trace"; import {services} from "../common/coreservices"; import { @@ -36,7 +34,7 @@ export class Transition implements IHookRegistry { $id: number; private _deferred = services.$q.defer(); - promise: IPromise = this._deferred.promise; + promise: Promise = this._deferred.promise; private _options: TransitionOptions; private _treeChanges: TreeChanges; @@ -337,7 +335,7 @@ export class Transition implements IHookRegistry { * * @returns a promise for a successful transition. */ - run (): IPromise { + run (): Promise { let hookBuilder = this.hookBuilder(); let runSynchronousHooks = TransitionHook.runSynchronousHooks; // TODO: nuke these in favor of chaining off the promise, i.e., diff --git a/src/transition/transitionHook.ts b/src/transition/transitionHook.ts index 048fbfa0a..b34329564 100644 --- a/src/transition/transitionHook.ts +++ b/src/transition/transitionHook.ts @@ -1,5 +1,4 @@ /** @module transition */ /** for typedoc */ -import {IPromise} from "angular"; import {TransitionHookOptions} from "./interface"; import {IInjectable, defaults, extend, noop, fnToString, maxLength, Predicate} from "../common/common"; import {isDefined, isPromise } from "../common/predicates"; @@ -87,7 +86,7 @@ export class TransitionHook { * * Returns a promise chain composed of any promises returned from each hook.invokeStep() call */ - static runSynchronousHooks(hooks: TransitionHook[], locals = {}, swallowExceptions: boolean = false): IPromise { + static runSynchronousHooks(hooks: TransitionHook[], locals = {}, swallowExceptions: boolean = false): Promise { let results = []; for (let i = 0; i < hooks.length; i++) { try { diff --git a/src/transition/transitionService.ts b/src/transition/transitionService.ts index 15e69668f..aa3283769 100644 --- a/src/transition/transitionService.ts +++ b/src/transition/transitionService.ts @@ -1,6 +1,4 @@ /** @module transition */ /** for typedoc */ -/// - import {IHookRegistry, ITransitionService, TransitionOptions, IHookRegistration} from "./interface"; import {Transition} from "./transition"; diff --git a/src/ui-router.ts b/src/ui-router.ts index 260e73057..6f6b77c60 100644 --- a/src/ui-router.ts +++ b/src/ui-router.ts @@ -8,4 +8,4 @@ import * as url from "./url/module"; import * as view from "./view/module"; export { common, params, path, resolve, state, transition, url, view }; -export {Router} from "./router"; +export {UIRouter} from "./router"; diff --git a/src/url/urlMatcherConfig.ts b/src/url/urlMatcherConfig.ts index e9a51a5e5..d6dec34cb 100644 --- a/src/url/urlMatcherConfig.ts +++ b/src/url/urlMatcherConfig.ts @@ -1,7 +1,7 @@ /** @module url */ /** for typedoc */ import {isDefined, isString} from "../common/predicates"; -class MatcherConfig { +export class MatcherConfig { _isCaseInsensitive: boolean = false; _isStrictMode: boolean = true; _defaultSquashPolicy: (boolean|string) = false; @@ -21,4 +21,5 @@ class MatcherConfig { } } +// TODO: Do not export global instance; create one in UIRouter() constructor export let matcherConfig = new MatcherConfig(); diff --git a/src/url/urlMatcherFactory.ts b/src/url/urlMatcherFactory.ts index 6f1bf4cd3..b2cf6f5bc 100644 --- a/src/url/urlMatcherFactory.ts +++ b/src/url/urlMatcherFactory.ts @@ -1,5 +1,4 @@ /** @module url */ /** for typedoc */ -/// import {forEach, extend} from "../common/common"; import {isObject, isDefined, isFunction} from "../common/predicates"; diff --git a/src/url/urlRouter.ts b/src/url/urlRouter.ts index 8e5b9c82b..6c0ef2bec 100644 --- a/src/url/urlRouter.ts +++ b/src/url/urlRouter.ts @@ -1,5 +1,4 @@ /** @module url */ /** for typedoc */ -/// import {extend, bindFunctions} from "../common/common"; import {isFunction, isString, isDefined, isArray} from "../common/predicates"; import {UrlMatcher} from "./module"; diff --git a/src/view/templateFactory.ts b/src/view/templateFactory.ts index 4c42ea91c..cc41851f6 100644 --- a/src/view/templateFactory.ts +++ b/src/view/templateFactory.ts @@ -1,5 +1,4 @@ /** @module view */ /** for typedoc */ -/// import {isDefined, isFunction} from "../common/predicates"; import {services} from "../common/coreservices"; import {ViewDeclaration} from "../state/interface"; diff --git a/test/hookBuilderSpec.ts b/test/hookBuilderSpec.ts index 364614276..240642c43 100644 --- a/test/hookBuilderSpec.ts +++ b/test/hookBuilderSpec.ts @@ -1,5 +1,4 @@ -import {Router} from "../src/ui-router"; -import {HookBuilder} from "../src/transition/hookBuilder"; +import {UIRouter} from "../src/ui-router"; import {TransitionService} from "../src/transition/transitionService"; import {tree2Array} from "./stateHelper.ts"; import {StateService} from "../src/state/stateService"; @@ -11,7 +10,7 @@ import {tail} from "../src/common/common"; import {PathFactory} from "../src/path/pathFactory"; describe('HookBuilder:', function() { - let uiRouter: Router = null; + let uiRouter: UIRouter = null; let $trans: TransitionService = null; let $state: StateService = null; let root: State = null; @@ -22,7 +21,7 @@ describe('HookBuilder:', function() { beforeEach(() => { log = ""; - uiRouter = new Router(); + uiRouter = new UIRouter(); $trans = uiRouter.transitionService; $state = uiRouter.stateService; root = uiRouter.stateRegistry.root();