@angular-wave/angular.ts 0.0.29 → 0.0.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/angular-ts.esm.js +1 -1
  2. package/dist/angular-ts.umd.js +1 -1
  3. package/index.html +5 -6
  4. package/package.json +1 -1
  5. package/src/core/controller.js +3 -0
  6. package/src/directive/controller.js +0 -56
  7. package/src/directive/controller.md +46 -0
  8. package/src/router/common/trace.js +1 -1
  9. package/src/router/directives/state-directives.js +1 -1
  10. package/src/router/hooks/update-globals.js +1 -1
  11. package/src/router/hooks/url.js +4 -4
  12. package/src/router/index.js +0 -6
  13. package/src/router/injectables.js +9 -60
  14. package/src/router/resolve/resolve-context.js +1 -1
  15. package/src/router/router.js +3 -95
  16. package/src/router/services.js +2 -58
  17. package/src/router/state/state-builder.js +7 -6
  18. package/src/router/state/state-object.js +1 -1
  19. package/src/router/state/state-registry.js +6 -5
  20. package/src/router/state/state-service.js +4 -5
  21. package/src/router/state/target-state.js +1 -1
  22. package/src/router/state/views.js +1 -1
  23. package/src/router/url/url-config.js +25 -2
  24. package/src/router/url/url-matcher.js +0 -8
  25. package/src/router/url/url-service.js +138 -8
  26. package/src/router/view/view.js +3 -1
  27. package/src/shared/common.js +2 -2
  28. package/test/router/services.spec.js +8 -17
  29. package/test/router/{url-matcher-factory.spec.js → url-service.spec.js} +126 -130
  30. package/test/router/view.spec.js +4 -11
  31. package/types/router/core/common/coreservices.d.ts +2 -2
  32. package/types/router/core/common/trace.d.ts +7 -7
  33. package/types/router/core/globals.d.ts +2 -1
  34. package/types/router/core/interface.d.ts +3 -10
  35. package/types/router/core/params/interface.d.ts +5 -5
  36. package/types/router/core/resolve/resolveContext.d.ts +4 -4
  37. package/types/router/core/router.d.ts +5 -51
  38. package/types/router/core/state/interface.d.ts +6 -6
  39. package/types/router/core/state/stateObject.d.ts +1 -1
  40. package/types/router/core/state/stateQueueManager.d.ts +2 -2
  41. package/types/router/core/state/stateRegistry.d.ts +4 -4
  42. package/types/router/core/state/stateService.d.ts +9 -9
  43. package/types/router/core/state/targetState.d.ts +1 -1
  44. package/types/router/core/transition/interface.d.ts +1 -1
  45. package/types/router/core/transition/transition.d.ts +12 -12
  46. package/types/router/core/transition/transitionService.d.ts +5 -5
  47. package/types/router/core/url/interface.d.ts +3 -3
  48. package/types/router/core/url/urlConfig.d.ts +3 -3
  49. package/types/router/core/url/urlMatcherFactory.d.ts +4 -4
  50. package/types/router/core/url/urlRouter.d.ts +2 -2
  51. package/types/router/core/url/urlRule.d.ts +6 -6
  52. package/types/router/core/url/urlRules.d.ts +6 -6
  53. package/types/router/core/url/urlService.d.ts +8 -8
  54. package/types/router/core/view/interface.d.ts +1 -1
  55. package/types/router/core/view/view.d.ts +15 -15
  56. package/types/router/directives/viewDirective.d.ts +4 -4
  57. package/types/router/interface.d.ts +4 -4
  58. package/types/router/locationServices.d.ts +3 -3
  59. package/types/router/services.d.ts +1 -1
  60. package/types/router/stateProvider.d.ts +2 -2
  61. package/types/router/viewScroll.d.ts +1 -1
  62. package/src/router/url/url-matcher-factory.js +0 -77
  63. package/src/router/url/url-router.js +0 -101
@@ -21,7 +21,7 @@ describe("view", () => {
21
21
  $injector,
22
22
  elem,
23
23
  $controllerProvider,
24
- $urlMatcherFactoryProvider,
24
+ $urlServiceProvider,
25
25
  $view,
26
26
  $q;
27
27
  let root, states;
@@ -34,16 +34,12 @@ describe("view", () => {
34
34
  window.angular
35
35
  .module("defaultModule", ["ng.router"])
36
36
  .config(
37
- function (
38
- _$provide_,
39
- _$controllerProvider_,
40
- _$urlMatcherFactoryProvider_,
41
- ) {
37
+ function (_$provide_, _$controllerProvider_, _$urlServiceProvider_) {
42
38
  _$provide_.factory("foo", () => {
43
39
  return "Foo";
44
40
  });
45
41
  $controllerProvider = _$controllerProvider_;
46
- $urlMatcherFactoryProvider = _$urlMatcherFactoryProvider_;
42
+ $urlServiceProvider = _$urlServiceProvider_;
47
43
  },
48
44
  );
49
45
  $injector = window.angular.bootstrap(document.getElementById("dummy"), [
@@ -58,10 +54,7 @@ describe("view", () => {
58
54
 
59
55
  states = {};
60
56
  const matcher = new StateMatcher(states);
61
- const stateBuilder = new StateBuilder(
62
- matcher,
63
- $urlMatcherFactoryProvider,
64
- );
57
+ const stateBuilder = new StateBuilder(matcher, $urlServiceProvider);
65
58
  stateBuilder.builder("views", ng1ViewsBuilder);
66
59
  register = registerState(states, stateBuilder);
67
60
  root = register({ name: "" });
@@ -39,7 +39,7 @@ export interface CoreServices {
39
39
  * Implementors should pass these through to the underlying URL mechanism.
40
40
  * The underlying URL mechanism might be browser APIs, framework APIs, or some 3rd party URL management library.
41
41
  *
42
- * UI-Router Core includes three basic implementations:
42
+ * Router Core includes three basic implementations:
43
43
  *
44
44
  * - [[PushStateLocationService]]
45
45
  * - [[HashLocationService]]
@@ -61,7 +61,7 @@ export interface LocationServices {
61
61
  * Implementors should pass these through to the underlying URL APIs.
62
62
  * The underlying URL mechanism might be browser APIs, framework APIs, or some 3rd party URL management library.
63
63
  *
64
- * UI-Router Core includes two basic implementations:
64
+ * Router Core includes two basic implementations:
65
65
  *
66
66
  * - [[BrowserLocationConfig]]
67
67
  * - [[MemoryLocationConfig]]
@@ -1,6 +1,6 @@
1
1
  import { Transition } from "../transition/transition";
2
2
  import { ViewTuple } from "../view";
3
- import { ActiveUIView, ViewConfig, ViewContext } from "../view/interface";
3
+ import { ActiveNGView, ViewConfig, ViewContext } from "../view/interface";
4
4
  import { Resolvable } from "../resolve/resolvable";
5
5
  import { PathNode } from "../path/pathNode";
6
6
  import { PolicyWhen } from "../resolve/interface";
@@ -24,12 +24,12 @@ declare enum Category {
24
24
  RESOLVE = 0,
25
25
  TRANSITION = 1,
26
26
  HOOK = 2,
27
- UIVIEW = 3,
27
+ NGVIEW = 3,
28
28
  VIEWCONFIG = 4,
29
29
  }
30
30
  export { Category };
31
31
  /**
32
- * Prints UI-Router Transition trace information to the console.
32
+ * Prints Router Transition trace information to the console.
33
33
  */
34
34
  export declare class Trace {
35
35
  /** @internal */
@@ -101,17 +101,17 @@ export declare class Trace {
101
101
  /** @internal called by ui-router code */
102
102
  traceSuccess(finalState: StateObject, trans: Transition): void;
103
103
  /** @internal called by ui-router code */
104
- traceUIViewEvent(event: string, viewData: ActiveUIView, extra?: string): void;
104
+ traceNGViewEvent(event: string, viewData: ActiveNGView, extra?: string): void;
105
105
  /** @internal called by ui-router code */
106
- traceUIViewConfigUpdated(viewData: ActiveUIView, context: ViewContext): void;
106
+ traceNGViewConfigUpdated(viewData: ActiveNGView, context: ViewContext): void;
107
107
  /** @internal called by ui-router code */
108
- traceUIViewFill(viewData: ActiveUIView, html: string): void;
108
+ traceNGViewFill(viewData: ActiveNGView, html: string): void;
109
109
  /** @internal called by ui-router code */
110
110
  traceViewSync(pairs: ViewTuple[]): void;
111
111
  /** @internal called by ui-router code */
112
112
  traceViewServiceEvent(event: string, viewConfig: ViewConfig): void;
113
113
  /** @internal called by ui-router code */
114
- traceViewServiceUIViewEvent(event: string, viewData: ActiveUIView): void;
114
+ traceViewServiceNGViewEvent(event: string, viewData: ActiveNGView): void;
115
115
  }
116
116
  /**
117
117
  * The [[Trace]] singleton
@@ -3,12 +3,13 @@ import { StateDeclaration } from "./state/interface";
3
3
  import { StateObject } from "./state/stateObject";
4
4
  import { Transition } from "./transition/transition";
5
5
  import { Queue } from "./common/queue";
6
+ /**
6
7
  * Global router state
7
8
  *
8
9
  * This is where we hold the global mutable state such as current state, current
9
10
  * params, current transition, etc.
10
11
  */
11
- export declare class UIRouterGlobals {
12
+ export declare class RouterGlobals {
12
13
  /**
13
14
  * Current parameter values
14
15
  *
@@ -1,9 +1,9 @@
1
- import { UIRouter } from "./router";
1
+ import { Router } from "./router";
2
2
  /**
3
3
  * An interface for getting values from dependency injection.
4
4
  *
5
5
  * This is primarily used to get resolve values for a given token.
6
- * An instance of the `UIInjector` can be retrieved from the current transition using [[Transition.injector]].
6
+ * An instance of the `NGInjector` can be retrieved from the current transition using [[Transition.injector]].
7
7
  *
8
8
  * ---
9
9
  *
@@ -13,7 +13,7 @@ import { UIRouter } from "./router";
13
13
  * In Angular 2, the native injector might be the root Injector,
14
14
  * or it might be a lazy loaded `NgModule` injector scoped to a lazy load state tree.
15
15
  */
16
- export interface UIInjector {
16
+ export interface NGInjector {
17
17
  /**
18
18
  * Gets a value from the injector.
19
19
  *
@@ -89,10 +89,3 @@ export interface UIInjector {
89
89
  getNative(token: any): any;
90
90
  getNative<T>(token: any): T;
91
91
  }
92
- export interface UIRouterPlugin {
93
- name: string;
94
- }
95
- export declare abstract class UIRouterPluginBase implements UIRouterPlugin {
96
- abstract name: string;
97
- dispose(router: UIRouter): void;
98
- }
@@ -53,7 +53,7 @@ export interface ParamDeclaration {
53
53
  * Specifies the default value for this parameter.
54
54
  * This implicitly sets this parameter as optional.
55
55
  *
56
- * When UI-Router routes to a state and no value is specified for this parameter in the URL or transition,
56
+ * When Router routes to a state and no value is specified for this parameter in the URL or transition,
57
57
  * the default value will be used instead.
58
58
  * If value is a function, it will be injected and invoked, and the return value used.
59
59
  *
@@ -245,7 +245,7 @@ export interface ParamDeclaration {
245
245
  * Normally, if a parameter value changes, the state which declared that the parameter will be reloaded (entered/exited).
246
246
  * When a parameter is `dynamic`, a transition still occurs, but it does not cause the state to exit/enter.
247
247
  *
248
- * This can be useful to build UI where the component updates itself when the param values change.
248
+ * This can be useful to build NG where the component updates itself when the param values change.
249
249
  * A common scenario where this is useful is searching/paging/sorting.
250
250
  *
251
251
  * ---
@@ -373,7 +373,7 @@ export interface Replace {
373
373
  * - some internal string representation
374
374
  *
375
375
  * Typed parameter definitions control how parameter values are encoded (to the URL) and decoded (from the URL).
376
- * UI-Router always provides the decoded parameter values to the user (from methods such as [[Transition.params]])).
376
+ * Router always provides the decoded parameter values to the user (from methods such as [[Transition.params]])).
377
377
  *
378
378
  * For example, if a state has a url of `/foo/{fooId:int}` (the `fooId` parameter is of the `int` ParamType)
379
379
  * and if the browser is at `/foo/123`, then the 123 is parsed as an integer:
@@ -395,7 +395,7 @@ export interface Replace {
395
395
  * @example
396
396
  * ```
397
397
  *
398
- * $urlMatcherFactoryProvider.type('intarray', {
398
+ * $urlServiceProvider.type('intarray', {
399
399
  * // Take an array of ints [1,2,3] and return a string "1-2-3"
400
400
  * encode: (array) => array.join("-"),
401
401
  *
@@ -432,7 +432,7 @@ export interface Replace {
432
432
  *
433
433
  * var list = ['John', 'Paul', 'George', 'Ringo'];
434
434
  *
435
- * $urlMatcherFactoryProvider.type('listItem', {
435
+ * $urlServiceProvider.type('listItem', {
436
436
  * encode: function(item) {
437
437
  * // Represent the list item in the URL using its corresponding index
438
438
  * return list.indexOf(item);
@@ -3,12 +3,12 @@ import { PathNode } from "../path/pathNode";
3
3
  import { Resolvable } from "./resolvable";
4
4
  import { StateObject } from "../state/stateObject";
5
5
  import { Transition } from "../transition/transition";
6
- import { UIInjector } from "../interface";
6
+ import { NGInjector } from "../interface";
7
7
  export declare const NATIVE_INJECTOR_TOKEN: string;
8
8
  /**
9
9
  * Encapsulates Dependency Injection for a path of nodes
10
10
  *
11
- * UI-Router states are organized as a tree.
11
+ * Router states are organized as a tree.
12
12
  * A nested state has a path of ancestors to the root of the tree.
13
13
  * When a state is being activated, each element in the path is wrapped as a [[PathNode]].
14
14
  * A `PathNode` is a stateful object that holds things like parameters and resolvables for the state being activated.
@@ -17,7 +17,7 @@ export declare const NATIVE_INJECTOR_TOKEN: string;
17
17
  */
18
18
  export declare class ResolveContext {
19
19
  private _path;
20
- _injector: UIInjector;
20
+ _injector: NGInjector;
21
21
  constructor(_path: PathNode[]);
22
22
  /** Gets all the tokens found in the resolve context, de-duplicated */
23
23
  getTokens(): any[];
@@ -86,7 +86,7 @@ export declare class ResolveContext {
86
86
  value: any;
87
87
  }[]
88
88
  >;
89
- injector(): UIInjector;
89
+ injector(): NGInjector;
90
90
  findNode(resolvable: Resolvable): PathNode;
91
91
  /**
92
92
  * Gets the async dependencies of a Resolvable
@@ -4,17 +4,16 @@ import { TransitionService } from "./transition/transitionService";
4
4
  import { ViewService } from "./view/view";
5
5
  import { StateRegistry } from "./state/stateRegistry";
6
6
  import { StateService } from "./state/stateService";
7
- import { UIRouterGlobals } from "./globals";
8
- import { UIRouterPlugin } from "./interface";
7
+ import { RouterGlobals } from "./globals";
9
8
  import { UrlService } from "./url/urlService";
10
9
  import { LocationServices, LocationConfig } from "./common/coreservices";
11
10
  import { Trace } from "./common/trace";
12
11
  /**
13
- * An instance of UI-Router.
12
+ * An instance of Router.
14
13
  *
15
14
  * This object contains references to service APIs which define your application's routing behavior.
16
15
  */
17
- export declare class UIRouter {
16
+ export declare class Router {
18
17
  locationService: LocationServices;
19
18
  locationConfig: LocationConfig;
20
19
  /** @internal */ $id: number;
@@ -25,7 +24,7 @@ export declare class UIRouter {
25
24
  /** Provides services related to ui-view synchronization */
26
25
  viewService: ViewService;
27
26
  /** An object that contains global router state, such as the current state and params */
28
- globals: UIRouterGlobals;
27
+ globals: RouterGlobals;
29
28
  /** A service that exposes global Transition Hooks */
30
29
  transitionService: TransitionService;
31
30
  /**
@@ -44,23 +43,8 @@ export declare class UIRouter {
44
43
  stateRegistry: StateRegistry;
45
44
  /** Provides services related to states */
46
45
  stateService: StateService;
47
- /** @internal plugin instances are registered here */
48
- private _plugins;
49
-
50
46
  /**
51
- * Disposes this router instance
52
- *
53
- * When called, clears resources retained by the router by calling `dispose(this)` on all
54
- * registered [[disposable]] objects.
55
- *
56
- * Or, if a `disposable` object is provided, calls `dispose(this)` on that object only.
57
- *
58
- * @internal
59
- * @param disposable (optional) the disposable to dispose
60
- */
61
- dispose(disposable?: any): void;
62
- /**
63
- * Creates a new `UIRouter` object
47
+ * Creates a new `Router` object
64
48
  *
65
49
  * @param locationService a [[LocationServices]] implementation
66
50
  * @param locationConfig a [[LocationConfig]] implementation
@@ -70,34 +54,4 @@ export declare class UIRouter {
70
54
  locationService?: LocationServices,
71
55
  locationConfig?: LocationConfig,
72
56
  );
73
- /** Add plugin (as ES6 class) */
74
- plugin<T extends UIRouterPlugin>(
75
- plugin: {
76
- new (router: UIRouter, options?: any): T;
77
- },
78
- options?: any,
79
- ): T;
80
- /** Add plugin (as javascript constructor function) */
81
- plugin<T extends UIRouterPlugin>(
82
- plugin: {
83
- (router: UIRouter, options?: any): void;
84
- },
85
- options?: any,
86
- ): T;
87
- /** Add plugin (as javascript factory function) */
88
- plugin<T extends UIRouterPlugin>(plugin: PluginFactory<T>, options?: any): T;
89
- /**
90
- * Returns a plugin registered with the given `pluginName`.
91
- *
92
- * @param pluginName the name of the plugin to get
93
- * @return the plugin, or undefined
94
- */
95
- getPlugin(pluginName: string): UIRouterPlugin;
96
- /**
97
- * Returns all registered plugins
98
- * @return all registered plugins
99
- */
100
- getPlugin(): UIRouterPlugin[];
101
57
  }
102
- /** @internal */
103
- export declare type PluginFactory<T> = (router: UIRouter, options?: any) => T;
@@ -31,7 +31,7 @@ export declare type ResolveTypes =
31
31
  * Base interface for declaring a view
32
32
  *
33
33
  * This interface defines the basic data that a normalized view declaration will have on it.
34
- * Each implementation of UI-Router (for a specific framework) should define its own extension of this interface.
34
+ * Each implementation of Router (for a specific framework) should define its own extension of this interface.
35
35
  * Add any additional fields that the framework requires to that interface.
36
36
  */
37
37
  export interface _ViewDeclaration {
@@ -86,7 +86,7 @@ export declare type RedirectToResult =
86
86
  /**
87
87
  * The StateDeclaration object is used to define a state or nested state.
88
88
  *
89
- * Note: Each implementation of UI-Router (for a specific framework)
89
+ * Note: Each implementation of Router (for a specific framework)
90
90
  * extends this interface as necessary.
91
91
  *
92
92
  * #### Example:
@@ -203,7 +203,7 @@ export interface StateDeclaration {
203
203
  * - Each key (string) is the name of the dependency.
204
204
  * - Each value (function) is an injectable function which returns the dependency, or a promise for the dependency.
205
205
  *
206
- * This style is based on AngularJS injectable functions, but can be used with any UI-Router implementation.
206
+ * This style is based on AngularJS injectable functions, but can be used with any Router implementation.
207
207
  * If your code will be minified, the function should be ["annotated" in the AngularJS manner](https://docs.angularjs.org/guide/di#dependency-annotation).
208
208
  *
209
209
  * #### AngularJS Example:
@@ -257,7 +257,7 @@ export interface StateDeclaration {
257
257
  *
258
258
  * #### Special injectable tokens
259
259
  *
260
- * - `UIRouter`: The [[UIRouter]] instance which has references to all the UI-Router services.
260
+ * - `Router`: The [[Router]] instance which has references to all the Router services.
261
261
  * - `Transition`: The current [[Transition]] object; information and API about the current transition, such as
262
262
  * "to" and "from" State Parameters and transition options.
263
263
  * - `'$transition$'`: A string alias for the `Transition` injectable
@@ -428,7 +428,7 @@ export interface StateDeclaration {
428
428
  *
429
429
  * Note: `redirectTo` is processed as an `onStart` hook, before `LAZY` resolves.
430
430
  * If your redirect function relies on resolve data, get the [[Transition.injector]] and get a
431
- * promise for the resolve data using [[UIInjector.getAsync]].
431
+ * promise for the resolve data using [[NGInjector.getAsync]].
432
432
  *
433
433
  * #### Example:
434
434
  * ```js
@@ -595,7 +595,7 @@ export interface StateDeclaration {
595
595
  * It matches any state name that starts with the `name` (including child states that are not yet loaded).
596
596
  * - A `url` prefix.
597
597
  * A future state's `url` property acts as a wildcard.
598
- * UI-Router matches all paths that begin with the `url`.
598
+ * Router matches all paths that begin with the `url`.
599
599
  * It effectively appends `.*` to the internal regular expression.
600
600
  * When the prefix matches, the future state will begin loading.
601
601
  * - A `lazyLoad` function.
@@ -12,7 +12,7 @@ import { TargetState } from "./targetState";
12
12
  import { Transition } from "../transition/transition";
13
13
  import { Glob } from "../common/glob";
14
14
  /**
15
- * Internal representation of a UI-Router state.
15
+ * Internal representation of a Router state.
16
16
  *
17
17
  * Instances of this class are created when a [[StateDeclaration]] is registered with the [[StateRegistry]].
18
18
  *
@@ -2,7 +2,7 @@ import { _StateDeclaration } from "./interface";
2
2
  import { StateObject } from "./stateObject";
3
3
  import { StateBuilder } from "./stateBuilder";
4
4
  import { StateRegistryListener } from "./stateRegistry";
5
- import { UIRouter } from "../router";
5
+ import { Router } from "../router";
6
6
  export declare class StateQueueManager {
7
7
  private router;
8
8
  states: {
@@ -12,7 +12,7 @@ export declare class StateQueueManager {
12
12
  listeners: StateRegistryListener[];
13
13
  queue: StateObject[];
14
14
  constructor(
15
- router: UIRouter,
15
+ router: Router,
16
16
  states: {
17
17
  [key: string]: StateObject;
18
18
  },
@@ -4,7 +4,7 @@ import { StateQueueManager } from "./stateQueueManager";
4
4
  import { StateDeclaration, _StateDeclaration } from "./interface";
5
5
  import { BuilderFunction } from "./stateBuilder";
6
6
  import { StateOrName } from "./interface";
7
- import { UIRouter } from "../router";
7
+ import { Router } from "../router";
8
8
  /**
9
9
  * The signature for the callback function provided to [[StateRegistry.onStatesChanged]].
10
10
  *
@@ -20,7 +20,7 @@ export declare type StateRegistryListener = (
20
20
  /**
21
21
  * A registry for all of the application's [[StateDeclaration]]s
22
22
  *
23
- * This API is found at `router.stateRegistry` ([[UIRouter.stateRegistry]])
23
+ * This API is found at `router.stateRegistry` ([[Router.stateRegistry]])
24
24
  */
25
25
  export declare class StateRegistry {
26
26
  init($injector: any): void;
@@ -35,7 +35,7 @@ export declare class StateRegistry {
35
35
  /** @internal */
36
36
  listeners: StateRegistryListener[];
37
37
  /** @internal */
38
- constructor(router: UIRouter);
38
+ constructor(router: Router);
39
39
  /** @internal */
40
40
  private _registerRoot;
41
41
  /**
@@ -73,7 +73,7 @@ export declare class StateRegistry {
73
73
  * Gets the implicit root state
74
74
  *
75
75
  * Gets the root of the state tree.
76
- * The root state is implicitly created by UI-Router.
76
+ * The root state is implicitly created by Router.
77
77
  * Note: this returns the internal [[StateObject]] representation, not a [[StateDeclaration]]
78
78
  *
79
79
  * @return the root [[StateObject]]
@@ -10,18 +10,18 @@ import {
10
10
  import { StateObject } from "./stateObject";
11
11
  import { TargetState } from "./targetState";
12
12
  import { RawParams } from "../params/interface";
13
- import { UIRouter } from "../router";
14
- import { UIInjector } from "../interface";
13
+ import { Router } from "../router";
14
+ import { NGInjector } from "../interface";
15
15
  import { StateParams } from "../params/stateParams";
16
16
  export declare type OnInvalidCallback = (
17
17
  toState?: TargetState,
18
18
  fromState?: TargetState,
19
- injector?: UIInjector,
19
+ injector?: NGInjector,
20
20
  ) => HookResult;
21
21
  /**
22
22
  * Provides services related to ui-router states.
23
23
  *
24
- * This API is located at `router.stateService` ([[UIRouter.stateService]])
24
+ * This API is located at `router.stateService` ([[Router.stateService]])
25
25
  */
26
26
  export declare class StateService {
27
27
  private router;
@@ -30,29 +30,29 @@ export declare class StateService {
30
30
  /**
31
31
  * The [[Transition]] currently in progress (or null)
32
32
  *
33
- * @deprecated This is a passthrough through to [[UIRouterGlobals.transition]]
33
+ * @deprecated This is a passthrough through to [[RouterGlobals.transition]]
34
34
  */
35
35
  transition: Transition;
36
36
  /**
37
37
  * The latest successful state parameters
38
38
  *
39
- * @deprecated This is a passthrough through to [[UIRouterGlobals.params]]
39
+ * @deprecated This is a passthrough through to [[RouterGlobals.params]]
40
40
  */
41
41
  params: StateParams;
42
42
  /**
43
43
  * The current [[StateDeclaration]]
44
44
  *
45
- * @deprecated This is a passthrough through to [[UIRouterGlobals.current]]
45
+ * @deprecated This is a passthrough through to [[RouterGlobals.current]]
46
46
  */
47
47
  current: StateDeclaration;
48
48
  /**
49
49
  * The current [[StateObject]] (an internal API)
50
50
  *
51
- * @deprecated This is a passthrough through to [[UIRouterGlobals.$current]]
51
+ * @deprecated This is a passthrough through to [[RouterGlobals.$current]]
52
52
  */
53
53
  $current: StateObject;
54
54
  /** @internal */
55
- constructor(/** @internal */ router: UIRouter);
55
+ constructor(/** @internal */ router: Router);
56
56
 
57
57
  /**
58
58
  * Handler for when [[transitionTo]] is called with an invalid state.
@@ -25,7 +25,7 @@ import { RawParams } from "../params";
25
25
  * 3) and transition options
26
26
  * 4) the registered state object (the [[StateDeclaration]])
27
27
  *
28
- * Many UI-Router APIs such as [[StateService.go]] take a [[StateOrName]] argument which can
28
+ * Many Router APIs such as [[StateService.go]] take a [[StateOrName]] argument which can
29
29
  * either be a *state object* (a [[StateDeclaration]] or [[StateObject]]) or a *state name* (a string).
30
30
  * The `TargetState` class normalizes those options.
31
31
  *
@@ -103,7 +103,7 @@ export interface TransitionHookOptions {
103
103
  *
104
104
  * Get a TreeChanges object using [[Transition.treeChanges]]
105
105
  *
106
- * A UI-Router Transition is from one Path in a State Tree to another Path. For a given Transition,
106
+ * A Router Transition is from one Path in a State Tree to another Path. For a given Transition,
107
107
  * this object stores the "to" and "from" paths, as well as subsets of those: the "retained",
108
108
  * "exiting" and "entering" paths.
109
109
  *
@@ -15,8 +15,8 @@ import { StateObject } from "../state/stateObject";
15
15
  import { TargetState } from "../state/targetState";
16
16
  import { Resolvable } from "../resolve/resolvable";
17
17
  import { ViewConfig } from "../view/interface";
18
- import { UIRouter } from "../router";
19
- import { UIInjector } from "../interface";
18
+ import { Router } from "../router";
19
+ import { NGInjector } from "../interface";
20
20
  import { ResolvableLiteral } from "../resolve/interface";
21
21
  import { Rejection } from "./rejectFactory";
22
22
  /**
@@ -37,11 +37,11 @@ export declare class Transition implements IHookRegistry {
37
37
  */
38
38
  $id: number;
39
39
  /**
40
- * A reference to the [[UIRouter]] instance
40
+ * A reference to the [[Router]] instance
41
41
  *
42
42
  * This reference can be used to access the router services, such as the [[StateService]]
43
43
  */
44
- router: UIRouter;
44
+ router: Router;
45
45
  /** @internal */
46
46
  private _deferred;
47
47
  /**
@@ -139,10 +139,10 @@ export declare class Transition implements IHookRegistry {
139
139
  * @param fromPath The path of [[PathNode]]s from which the transition is leaving. The last node in the `fromPath`
140
140
  * encapsulates the "from state".
141
141
  * @param targetState The target state and parameters being transitioned to (also, the transition options)
142
- * @param router The [[UIRouter]] instance
142
+ * @param router The [[Router]] instance
143
143
  * @internal
144
144
  */
145
- constructor(fromPath: PathNode[], targetState: TargetState, router: UIRouter);
145
+ constructor(fromPath: PathNode[], targetState: TargetState, router: Router);
146
146
  private applyViewConfigs;
147
147
  /**
148
148
  * @internal
@@ -283,12 +283,12 @@ export declare class Transition implements IHookRegistry {
283
283
  };
284
284
  paramsChanged<T>(): T;
285
285
  /**
286
- * Creates a [[UIInjector]] Dependency Injector
286
+ * Creates a [[NGInjector]] Dependency Injector
287
287
  *
288
288
  * Returns a Dependency Injector for the Transition's target state (to state).
289
289
  * The injector provides resolve values which the target state has access to.
290
290
  *
291
- * The `UIInjector` can also provide values from the native root/global injector (ng1/ng2).
291
+ * The `NGInjector` can also provide values from the native root/global injector (ng1/ng2).
292
292
  *
293
293
  * #### Example:
294
294
  * ```js
@@ -300,7 +300,7 @@ export declare class Transition implements IHookRegistry {
300
300
  * ```
301
301
  *
302
302
  * In some cases (such as `onBefore`), you may need access to some resolve data but it has not yet been fetched.
303
- * You can use [[UIInjector.getAsync]] to get a promise for the data.
303
+ * You can use [[NGInjector.getAsync]] to get a promise for the data.
304
304
  * #### Example:
305
305
  * ```js
306
306
  * .onBefore({}, trans => {
@@ -335,9 +335,9 @@ export declare class Transition implements IHookRegistry {
335
335
  * @param state Limits the resolves provided to only the resolves the provided state has access to.
336
336
  * @param pathName Default: `'to'`: Chooses the path for which to create the injector. Use this to access resolves for `exiting` states.
337
337
  *
338
- * @returns a [[UIInjector]]
338
+ * @returns a [[NGInjector]]
339
339
  */
340
- injector(state?: StateOrName, pathName?: string): UIInjector;
340
+ injector(state?: StateOrName, pathName?: string): NGInjector;
341
341
  /**
342
342
  * Gets all available resolve tokens (keys)
343
343
  *
@@ -376,7 +376,7 @@ export declare class Transition implements IHookRegistry {
376
376
  *
377
377
  * Allows a transition hook to dynamically add a Resolvable to this Transition.
378
378
  *
379
- * Use the [[Transition.injector]] to retrieve the resolved data in subsequent hooks ([[UIInjector.get]]).
379
+ * Use the [[Transition.injector]] to retrieve the resolved data in subsequent hooks ([[NGInjector.get]]).
380
380
  *
381
381
  * If a `state` argument is provided, the Resolvable is processed when that state is being entered.
382
382
  * If no `state` is provided then the root state is used.
@@ -17,7 +17,7 @@ import { RegisteredHook } from "./hookRegistry";
17
17
  import { TargetState } from "../state/targetState";
18
18
  import { PathNode } from "../path/pathNode";
19
19
  import { ViewService } from "../view/view";
20
- import { UIRouter } from "../router";
20
+ import { Router } from "../router";
21
21
  import { TransitionEventType } from "./transitionEventType";
22
22
  import { GetResultHandler, GetErrorHandler } from "./transitionHook";
23
23
  /**
@@ -77,9 +77,9 @@ export interface TransitionServicePluginAPI {
77
77
  * - It allows the default transition error handler to be set.
78
78
  * - It also has a factory function for creating new [[Transition]] objects, (used internally by the [[StateService]]).
79
79
  *
80
- * At bootstrap, [[UIRouter]] creates a single instance (singleton) of this class.
80
+ * At bootstrap, [[Router]] creates a single instance (singleton) of this class.
81
81
  *
82
- * This API is located at `router.transitionService` ([[UIRouter.transitionService]])
82
+ * This API is located at `router.transitionService` ([[Router.transitionService]])
83
83
  */
84
84
  export declare class TransitionService implements IHookRegistry {
85
85
  /** @internal */
@@ -119,7 +119,7 @@ export declare class TransitionService implements IHookRegistry {
119
119
  lazyLoad: Function;
120
120
  };
121
121
  /** @internal */
122
- constructor(_router: UIRouter);
122
+ constructor(_router: Router);
123
123
  /**
124
124
  * Registers a [[TransitionHookFn]], called *while a transition is being constructed*.
125
125
  *
@@ -200,7 +200,7 @@ export declare class TransitionService implements IHookRegistry {
200
200
  * dispose
201
201
  * @internal
202
202
  */
203
- dispose(router: UIRouter): void;
203
+ dispose(router: Router): void;
204
204
  /**
205
205
  * Creates a new [[Transition]] object
206
206
  *
@@ -9,7 +9,7 @@
9
9
  * @preferred
10
10
  */
11
11
  import { LocationConfig } from "../common";
12
- import { UIRouter } from "../router";
12
+ import { Router } from "../router";
13
13
  import {
14
14
  StateDeclaration,
15
15
  StateObject,
@@ -83,7 +83,7 @@ export interface MatchResult {
83
83
  * @return the matched value, either truthy or falsey
84
84
  */
85
85
  export interface UrlRuleMatchFn {
86
- (url?: UrlParts, router?: UIRouter): any;
86
+ (url?: UrlParts, router?: Router): any;
87
87
  }
88
88
  /**
89
89
  * Handler invoked when a rule is matched
@@ -98,7 +98,7 @@ export interface UrlRuleHandlerFn {
98
98
  (
99
99
  matchValue?: any,
100
100
  url?: UrlParts,
101
- router?: UIRouter,
101
+ router?: Router,
102
102
  ): string | TargetState | TargetStateDef | void;
103
103
  }
104
104
  /** @internal */