@angular-wave/angular.ts 0.0.29 → 0.0.30
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.
- package/dist/angular-ts.esm.js +1 -1
- package/dist/angular-ts.umd.js +1 -1
- package/index.html +5 -6
- package/package.json +1 -1
- package/src/core/controller.js +3 -0
- package/src/directive/controller.js +0 -56
- package/src/directive/controller.md +46 -0
- package/src/router/common/trace.js +1 -1
- package/src/router/directives/state-directives.js +1 -1
- package/src/router/hooks/update-globals.js +1 -1
- package/src/router/injectables.js +8 -8
- package/src/router/resolve/resolve-context.js +1 -1
- package/src/router/router.js +1 -71
- package/src/router/services.js +2 -36
- package/src/router/state/state-object.js +1 -1
- package/src/router/state/state-registry.js +1 -1
- package/src/router/state/target-state.js +1 -1
- package/src/router/state/views.js +1 -1
- package/src/router/url/url-config.js +0 -2
- package/src/router/url/url-matcher-factory.js +0 -1
- package/src/router/url/url-matcher.js +0 -8
- package/src/router/url/url-service.js +6 -6
- package/src/router/view/view.js +2 -0
- package/src/shared/common.js +1 -1
- package/types/router/core/common/coreservices.d.ts +2 -2
- package/types/router/core/common/trace.d.ts +7 -7
- package/types/router/core/globals.d.ts +2 -1
- package/types/router/core/interface.d.ts +3 -10
- package/types/router/core/params/interface.d.ts +3 -3
- package/types/router/core/resolve/resolveContext.d.ts +4 -4
- package/types/router/core/router.d.ts +5 -51
- package/types/router/core/state/interface.d.ts +6 -6
- package/types/router/core/state/stateObject.d.ts +1 -1
- package/types/router/core/state/stateQueueManager.d.ts +2 -2
- package/types/router/core/state/stateRegistry.d.ts +4 -4
- package/types/router/core/state/stateService.d.ts +9 -9
- package/types/router/core/state/targetState.d.ts +1 -1
- package/types/router/core/transition/interface.d.ts +1 -1
- package/types/router/core/transition/transition.d.ts +12 -12
- package/types/router/core/transition/transitionService.d.ts +5 -5
- package/types/router/core/url/interface.d.ts +3 -3
- package/types/router/core/url/urlConfig.d.ts +3 -3
- package/types/router/core/url/urlMatcherFactory.d.ts +3 -3
- package/types/router/core/url/urlRouter.d.ts +2 -2
- package/types/router/core/url/urlRule.d.ts +6 -6
- package/types/router/core/url/urlRules.d.ts +6 -6
- package/types/router/core/url/urlService.d.ts +8 -8
- package/types/router/core/view/interface.d.ts +1 -1
- package/types/router/core/view/view.d.ts +15 -15
- package/types/router/directives/viewDirective.d.ts +4 -4
- package/types/router/interface.d.ts +4 -4
- package/types/router/locationServices.d.ts +3 -3
- package/types/router/services.d.ts +1 -1
- package/types/router/stateProvider.d.ts +2 -2
- package/types/router/viewScroll.d.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Router } from "../router";
|
|
2
2
|
import { UrlRule, UrlRuleHandlerFn } from "./interface";
|
|
3
3
|
import { TargetState, TargetStateDef } from "../state";
|
|
4
4
|
import { UrlMatcher } from "./urlMatcher";
|
|
@@ -11,7 +11,7 @@ import { UrlRuleFactory } from "./urlRule";
|
|
|
11
11
|
*
|
|
12
12
|
* The most commonly used methods are [[otherwise]] and [[when]].
|
|
13
13
|
*
|
|
14
|
-
* This API is found at `router.urlService.rules` (see: [[
|
|
14
|
+
* This API is found at `router.urlService.rules` (see: [[Router.urlService]], [[URLService.rules]])
|
|
15
15
|
*/
|
|
16
16
|
export declare class UrlRules {
|
|
17
17
|
private router;
|
|
@@ -23,9 +23,9 @@ export declare class UrlRules {
|
|
|
23
23
|
/** @internal */ private _rules;
|
|
24
24
|
/** @internal */ private _id;
|
|
25
25
|
/** @internal */
|
|
26
|
-
constructor(/** @internal */ router:
|
|
26
|
+
constructor(/** @internal */ router: Router);
|
|
27
27
|
/** @internal */
|
|
28
|
-
dispose(router?:
|
|
28
|
+
dispose(router?: Router): void;
|
|
29
29
|
/**
|
|
30
30
|
* Defines the initial state, path, or behavior to use when the app starts.
|
|
31
31
|
*
|
|
@@ -86,7 +86,7 @@ export declare class UrlRules {
|
|
|
86
86
|
* .otherwise({ state: 'home', params: { dashboard: 'default' } });
|
|
87
87
|
* ```
|
|
88
88
|
*
|
|
89
|
-
* - If `handler` is a function, the function receives the current url ([[UrlParts]]) and the [[
|
|
89
|
+
* - If `handler` is a function, the function receives the current url ([[UrlParts]]) and the [[Router]] object.
|
|
90
90
|
* The function can perform actions, and/or return a value.
|
|
91
91
|
*
|
|
92
92
|
* #### Example:
|
|
@@ -220,7 +220,7 @@ export declare class UrlRules {
|
|
|
220
220
|
*
|
|
221
221
|
* ---
|
|
222
222
|
*
|
|
223
|
-
* When the handler is a function, it receives the matched value, the current URL, and the `
|
|
223
|
+
* When the handler is a function, it receives the matched value, the current URL, and the `Router` object (See [[UrlRuleHandlerFn]]).
|
|
224
224
|
* The "matched value" differs based on the `matcher`.
|
|
225
225
|
* For [[UrlMatcher]]s, it will be the matched state params.
|
|
226
226
|
* For `RegExp`, it will be the match array from `regexp.exec()`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Router } from "../router";
|
|
2
2
|
import { LocationServices } from "../common";
|
|
3
3
|
import { MatchResult, UrlParts, UrlSyncApi } from "./interface";
|
|
4
4
|
import { UrlRules } from "./urlRules";
|
|
@@ -23,7 +23,7 @@ export declare class UrlService implements LocationServices, UrlSyncApi {
|
|
|
23
23
|
*/
|
|
24
24
|
config: UrlConfig;
|
|
25
25
|
/** @internal */
|
|
26
|
-
constructor(/** @internal */ router:
|
|
26
|
+
constructor(/** @internal */ router: Router);
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* Gets the current URL parts
|
|
@@ -56,9 +56,9 @@ export declare class UrlService implements LocationServices, UrlSyncApi {
|
|
|
56
56
|
* Starts or stops listening for URL changes
|
|
57
57
|
*
|
|
58
58
|
* Call this sometime after calling [[deferIntercept]] to start monitoring the url.
|
|
59
|
-
* This causes
|
|
59
|
+
* This causes Router to start listening for changes to the URL, if it wasn't already listening.
|
|
60
60
|
*
|
|
61
|
-
* If called with `false`,
|
|
61
|
+
* If called with `false`, Router will stop listening (call listen(true) to start listening again).
|
|
62
62
|
*
|
|
63
63
|
* #### Example:
|
|
64
64
|
* ```js
|
|
@@ -78,15 +78,15 @@ export declare class UrlService implements LocationServices, UrlSyncApi {
|
|
|
78
78
|
/**
|
|
79
79
|
* Disables monitoring of the URL.
|
|
80
80
|
*
|
|
81
|
-
* Call this method before
|
|
82
|
-
* It will stop
|
|
81
|
+
* Call this method before Router has bootstrapped.
|
|
82
|
+
* It will stop Router from performing the initial url sync.
|
|
83
83
|
*
|
|
84
84
|
* This can be useful to perform some asynchronous initialization before the router starts.
|
|
85
|
-
* Once the initialization is complete, call [[listen]] to tell
|
|
85
|
+
* Once the initialization is complete, call [[listen]] to tell Router to start watching and synchronizing the URL.
|
|
86
86
|
*
|
|
87
87
|
* #### Example:
|
|
88
88
|
* ```js
|
|
89
|
-
* // Prevent
|
|
89
|
+
* // Prevent Router from automatically intercepting URL changes when it starts;
|
|
90
90
|
* urlService.deferIntercept();
|
|
91
91
|
*
|
|
92
92
|
* fetch('/states.json').then(resp => resp.json()).then(data => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TypedMap } from "../common/common";
|
|
2
2
|
import { PathNode } from "../path/pathNode";
|
|
3
|
-
import {
|
|
3
|
+
import { ActiveNGView, ViewContext, ViewConfig } from "./interface";
|
|
4
4
|
import { _ViewDeclaration } from "../state/interface";
|
|
5
|
-
import {
|
|
5
|
+
import { Router } from "../router";
|
|
6
6
|
export declare type ViewConfigFactory = (
|
|
7
7
|
path: PathNode[],
|
|
8
8
|
decl: _ViewDeclaration,
|
|
@@ -11,13 +11,13 @@ export interface ViewServicePluginAPI {
|
|
|
11
11
|
_rootViewContext(context?: ViewContext): ViewContext;
|
|
12
12
|
_viewConfigFactory(viewType: string, factory: ViewConfigFactory): any;
|
|
13
13
|
/** @param id router.$id + "." + ngView.id */
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
_registeredNGView(id: string): ActiveNGView;
|
|
15
|
+
_registeredNGViews(): ActiveNGView[];
|
|
16
16
|
_activeViewConfigs(): ViewConfig[];
|
|
17
17
|
_onSync(listener: ViewSyncListener): Function;
|
|
18
18
|
}
|
|
19
19
|
export interface ViewTuple {
|
|
20
|
-
ngView:
|
|
20
|
+
ngView: ActiveNGView;
|
|
21
21
|
viewConfig: ViewConfig;
|
|
22
22
|
}
|
|
23
23
|
export interface ViewSyncListener {
|
|
@@ -33,9 +33,9 @@ export interface ViewSyncListener {
|
|
|
33
33
|
* The views from exited states are deactivated via [[deactivateViewConfig]].
|
|
34
34
|
* (See: the [[registerActivateViews]] Transition Hook)
|
|
35
35
|
*
|
|
36
|
-
* - As `ui-view` components pop in and out of existence, they register themselves using [[
|
|
36
|
+
* - As `ui-view` components pop in and out of existence, they register themselves using [[registerNGView]].
|
|
37
37
|
*
|
|
38
|
-
* - When the [[sync]] function is called, the registered `ui-view`(s) ([[
|
|
38
|
+
* - When the [[sync]] function is called, the registered `ui-view`(s) ([[ActiveNGView]])
|
|
39
39
|
* are configured with the matching [[ViewConfig]](s)
|
|
40
40
|
*
|
|
41
41
|
*/
|
|
@@ -106,8 +106,8 @@ export declare class ViewService {
|
|
|
106
106
|
* @internal
|
|
107
107
|
*/
|
|
108
108
|
static matches: (
|
|
109
|
-
ngViewsByFqn: TypedMap<
|
|
110
|
-
ngView:
|
|
109
|
+
ngViewsByFqn: TypedMap<ActiveNGView>,
|
|
110
|
+
ngView: ActiveNGView,
|
|
111
111
|
) => (viewConfig: ViewConfig) => boolean;
|
|
112
112
|
/**
|
|
113
113
|
* Normalizes a view's name from a state.views configuration block.
|
|
@@ -120,7 +120,7 @@ export declare class ViewService {
|
|
|
120
120
|
*
|
|
121
121
|
* @returns the normalized ngViewName and ngViewContextAnchor that the view targets
|
|
122
122
|
*/
|
|
123
|
-
static
|
|
123
|
+
static normalizeNGViewTarget(
|
|
124
124
|
context: ViewContext,
|
|
125
125
|
rawViewName?: string,
|
|
126
126
|
): {
|
|
@@ -128,7 +128,7 @@ export declare class ViewService {
|
|
|
128
128
|
ngViewContextAnchor: string;
|
|
129
129
|
};
|
|
130
130
|
/** @internal */
|
|
131
|
-
constructor(/** @internal */ router:
|
|
131
|
+
constructor(/** @internal */ router: Router);
|
|
132
132
|
/** @internal */
|
|
133
133
|
private _rootViewContext;
|
|
134
134
|
/** @internal */
|
|
@@ -154,13 +154,13 @@ export declare class ViewService {
|
|
|
154
154
|
* Note: the `ui-view` component uses the `ViewConfig` to determine what view should be loaded inside the `ui-view`,
|
|
155
155
|
* and what the view's state context is.
|
|
156
156
|
*
|
|
157
|
-
* Note: There is no corresponding `
|
|
158
|
-
* A `ui-view` should hang on to the return value of `
|
|
157
|
+
* Note: There is no corresponding `deregisterNGView`.
|
|
158
|
+
* A `ui-view` should hang on to the return value of `registerNGView` and invoke it to deregister itself.
|
|
159
159
|
*
|
|
160
|
-
* @param ngView The metadata for a
|
|
160
|
+
* @param ngView The metadata for a NGView
|
|
161
161
|
* @return a de-registration function used when the view is destroyed.
|
|
162
162
|
*/
|
|
163
|
-
|
|
163
|
+
registerNGView(ngView: ActiveNGView): () => void;
|
|
164
164
|
/**
|
|
165
165
|
* Returns the list of views currently available on the page, by fully-qualified name.
|
|
166
166
|
*
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/** @publicapi @module directives */ /** */
|
|
2
2
|
import { IDirective } from "../..";
|
|
3
|
-
import {
|
|
3
|
+
import { ActiveNGView } from "../core";
|
|
4
4
|
import { Ng1ViewConfig } from "../statebuilders/views";
|
|
5
5
|
|
|
6
6
|
/** @hidden */
|
|
7
|
-
export declare type
|
|
7
|
+
export declare type NGViewData = {
|
|
8
8
|
$cfg: Ng1ViewConfig;
|
|
9
|
-
$ngView:
|
|
9
|
+
$ngView: ActiveNGView;
|
|
10
10
|
};
|
|
11
11
|
/** @hidden */
|
|
12
|
-
export declare type
|
|
12
|
+
export declare type NGViewAnimData = {
|
|
13
13
|
$animEnter: Promise<any>;
|
|
14
14
|
$animLeave: Promise<any>;
|
|
15
15
|
$$animLeave: {
|
|
@@ -372,14 +372,14 @@ export interface Ng1ViewDeclaration extends _ViewDeclaration {
|
|
|
372
372
|
/**
|
|
373
373
|
* The shape of a controller for a view (and/or component), defining the controller callbacks.
|
|
374
374
|
*
|
|
375
|
-
* A view in
|
|
375
|
+
* A view in Router is comprised of either a `component` ([[Ng1ViewDeclaration.component]]) or a combination of a
|
|
376
376
|
* `template` (or `templateProvider`) and a `controller` (or `controllerProvider`).
|
|
377
377
|
*
|
|
378
378
|
* The `controller` object (or the `component`'s controller object) can define component-level controller callbacks,
|
|
379
|
-
* which
|
|
379
|
+
* which Router will call at the appropriate times. These callbacks are similar to Transition Hooks
|
|
380
380
|
* ([[IHookRegistry]]), but are only called if the view is currently active.
|
|
381
381
|
*
|
|
382
|
-
* This interface defines the
|
|
382
|
+
* This interface defines the Router component callbacks.
|
|
383
383
|
*
|
|
384
384
|
*/
|
|
385
385
|
export interface Ng1Controller {
|
|
@@ -468,7 +468,7 @@ export interface TemplateFactoryProvider {
|
|
|
468
468
|
/**
|
|
469
469
|
* Forces $templateFactory to use $http instead of $templateRequest.
|
|
470
470
|
*
|
|
471
|
-
*
|
|
471
|
+
* Router uses `$templateRequest` by default on angular 1.3+.
|
|
472
472
|
* Use this method to choose to use `$http` instead.
|
|
473
473
|
*
|
|
474
474
|
* ---
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @publicapi @module ng1 */ /** */
|
|
2
|
-
import { LocationConfig, LocationServices,
|
|
2
|
+
import { LocationConfig, LocationServices, Router } from "./core";
|
|
3
3
|
import { ILocationService, ILocationProvider, IWindowService } from "../index";
|
|
4
4
|
/**
|
|
5
|
-
* Implements
|
|
5
|
+
* Implements Router LocationServices and LocationConfig using Angular 1's $location service
|
|
6
6
|
* @internalapi
|
|
7
7
|
*/
|
|
8
8
|
export declare class Ng1LocationServices
|
|
@@ -34,7 +34,7 @@ export declare class Ng1LocationServices
|
|
|
34
34
|
*
|
|
35
35
|
* @param router
|
|
36
36
|
*/
|
|
37
|
-
static monkeyPatchPathParameterType(router:
|
|
37
|
+
static monkeyPatchPathParameterType(router: Router): void;
|
|
38
38
|
constructor($locationProvider: ILocationProvider);
|
|
39
39
|
onChange(callback: Function): () => Function[];
|
|
40
40
|
html5Mode(): any;
|
|
@@ -2,7 +2,7 @@ import { IRootScopeService } from "../";
|
|
|
2
2
|
import { ResolveContext, TypedMap } from "./core";
|
|
3
3
|
import { StateProvider } from "./stateProvider";
|
|
4
4
|
declare module "./core/lib/router" {
|
|
5
|
-
interface
|
|
5
|
+
interface Router {
|
|
6
6
|
/** @hidden */
|
|
7
7
|
stateProvider: StateProvider;
|
|
8
8
|
}
|
|
@@ -12,9 +12,9 @@ import { Ng1StateDeclaration } from "./interface";
|
|
|
12
12
|
* The `$stateProvider` works similar to Angular's v1 router, but it focuses purely
|
|
13
13
|
* on state.
|
|
14
14
|
*
|
|
15
|
-
* A state corresponds to a "place" in the application in terms of the overall
|
|
15
|
+
* A state corresponds to a "place" in the application in terms of the overall NG and
|
|
16
16
|
* navigation. A state describes (via the controller / template / view properties) what
|
|
17
|
-
* the
|
|
17
|
+
* the NG looks like and does at that place.
|
|
18
18
|
*
|
|
19
19
|
* States often have things in common, and the primary way of factoring out these
|
|
20
20
|
* commonalities in this model is via the state hierarchy, i.e. parent/child states aka
|