@angular-wave/angular.ts 0.0.27 → 0.0.28
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/README.md +1 -2
- package/dist/angular-ts.esm.js +1 -1
- package/dist/angular-ts.umd.js +1 -1
- package/e2e/unit.spec.ts +2 -1
- package/index.html +8 -9
- package/package.json +1 -1
- package/src/core/pubsub.js +329 -0
- package/src/router/hooks/core-resolvables.js +12 -11
- package/src/router/hooks/ignored-transition.js +1 -1
- package/src/router/hooks/lazy-load.js +40 -41
- package/src/router/hooks/redirect-to.js +32 -29
- package/src/router/hooks/update-globals.js +1 -1
- package/src/router/hooks/url.js +33 -24
- package/src/router/hooks/views.js +21 -20
- package/src/router/params/param-factory.js +17 -0
- package/src/router/router.js +74 -10
- package/src/router/state/state-queue-manager.js +5 -4
- package/src/router/state/state-registry.js +8 -5
- package/src/router/state/state-service.js +34 -29
- package/src/router/transition/hook-builder.js +2 -2
- package/src/router/transition/transition-hook.js +2 -1
- package/src/router/transition/transition-service.js +12 -18
- package/src/router/transition/transition.js +28 -25
- package/src/router/url/url-config.js +1 -49
- package/src/router/url/url-matcher-factory.js +10 -51
- package/src/router/url/url-router.js +27 -17
- package/src/router/url/url-rule.js +9 -13
- package/src/router/url/url-rules.js +3 -3
- package/src/router/url/url-service.js +22 -18
- package/src/router/view/view.js +3 -3
- package/src/shared/hof.js +1 -1
- package/test/angular.spec.js +1 -0
- package/test/aria/aria.spec.js +2 -1
- package/test/core/pubsub.spec.js +314 -0
- package/test/directive/bind.spec.js +2 -1
- package/test/directive/boolean.spec.js +4 -2
- package/test/directive/change.spec.js +1 -1
- package/test/directive/class.spec.js +1 -0
- package/test/directive/click.spec.js +2 -1
- package/test/directive/cloak.spec.js +1 -2
- package/test/directive/{constoller.spec.js → controller.spec.js} +1 -0
- package/test/directive/element-style.spec.js +1 -0
- package/test/directive/event.spec.js +1 -1
- package/test/directive/href.spec.js +2 -1
- package/test/directive/init.spec.js +1 -0
- package/test/directive/input.spec.js +200 -285
- package/test/directive/list.spec.js +2 -1
- package/test/directive/model.spec.js +1 -0
- package/test/directive/non-bindable.spec.js +2 -1
- package/test/directive/script.spec.js +1 -0
- package/test/directive/scrset.spec.js +2 -1
- package/test/directive/show-hide.spec.js +1 -0
- package/test/directive/src.spec.js +2 -1
- package/test/directive/style.spec.js +1 -0
- package/test/directive/switch.spec.js +2 -1
- package/test/directive/validators.spec.js +1 -1
- package/test/router/view-hook.spec.js +2 -2
- package/test/router/view-scroll.spec.js +1 -1
- package/test/router/view.spec.js +1 -1
- package/types/router/core/common/coreservices.d.ts +2 -3
- package/types/router/core/globals.d.ts +1 -4
- package/types/router/core/interface.d.ts +2 -8
- package/types/router/core/params/paramTypes.d.ts +0 -1
- package/types/router/core/router.d.ts +2 -3
- package/types/router/core/state/stateQueueManager.d.ts +1 -3
- package/types/router/core/state/stateRegistry.d.ts +0 -2
- package/types/router/core/state/stateService.d.ts +1 -2
- package/types/router/core/transition/interface.d.ts +3 -3
- package/types/router/core/transition/transitionService.d.ts +1 -2
- package/types/router/core/url/urlConfig.d.ts +1 -2
- package/types/router/core/url/urlRules.d.ts +1 -2
- package/types/router/core/url/urlService.d.ts +1 -2
- package/types/router/locationServices.d.ts +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dealoc } from "../../src/jqLite";
|
|
1
|
+
import { dealoc, jqLite } from "../../src/jqLite";
|
|
2
2
|
import { publishExternalAPI } from "../../src/public";
|
|
3
3
|
import { createInjector } from "../../src/injector";
|
|
4
4
|
|
|
@@ -18,6 +18,7 @@ describe("ngList", () => {
|
|
|
18
18
|
|
|
19
19
|
afterEach(() => {
|
|
20
20
|
dealoc(element);
|
|
21
|
+
jqLite.CACHE.clear();
|
|
21
22
|
});
|
|
22
23
|
|
|
23
24
|
function changeInputValue(val) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dealoc } from "../../src/jqLite";
|
|
1
|
+
import { dealoc, jqLite } from "../../src/jqLite";
|
|
2
2
|
import { publishExternalAPI } from "../../src/public";
|
|
3
3
|
import { createInjector } from "../../src/injector";
|
|
4
4
|
|
|
@@ -21,6 +21,7 @@ describe("ngNonBindable", () => {
|
|
|
21
21
|
|
|
22
22
|
afterEach(() => {
|
|
23
23
|
dealoc(element);
|
|
24
|
+
jqLite.CACHE.clear();
|
|
24
25
|
});
|
|
25
26
|
|
|
26
27
|
it("should prevent compilation of the owning element and its children", () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { publishExternalAPI } from "../../src/public";
|
|
2
2
|
import { createInjector } from "../../src/injector";
|
|
3
|
-
import { dealoc } from "../../src/jqLite";
|
|
3
|
+
import { dealoc, jqLite } from "../../src/jqLite";
|
|
4
4
|
|
|
5
5
|
describe("ngSrcset", () => {
|
|
6
6
|
let $scope;
|
|
@@ -17,6 +17,7 @@ describe("ngSrcset", () => {
|
|
|
17
17
|
|
|
18
18
|
afterEach(() => {
|
|
19
19
|
dealoc(element);
|
|
20
|
+
jqLite.CACHE.clear();
|
|
20
21
|
});
|
|
21
22
|
|
|
22
23
|
it("should not result empty string in img srcset", () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { publishExternalAPI } from "../../src/public";
|
|
2
2
|
import { createInjector } from "../../src/injector";
|
|
3
|
-
import { dealoc } from "../../src/jqLite";
|
|
3
|
+
import { dealoc, jqLite } from "../../src/jqLite";
|
|
4
4
|
|
|
5
5
|
describe("ngSrc", () => {
|
|
6
6
|
let $scope;
|
|
@@ -17,6 +17,7 @@ describe("ngSrc", () => {
|
|
|
17
17
|
|
|
18
18
|
afterEach(() => {
|
|
19
19
|
dealoc(element);
|
|
20
|
+
jqLite.CACHE.clear();
|
|
20
21
|
});
|
|
21
22
|
|
|
22
23
|
describe("img[ng-src]", () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { publishExternalAPI } from "../../src/public";
|
|
2
2
|
import { createInjector } from "../../src/injector";
|
|
3
|
-
import { dealoc } from "../../src/jqLite";
|
|
3
|
+
import { dealoc, jqLite } from "../../src/jqLite";
|
|
4
4
|
|
|
5
5
|
describe("ngSwitch", () => {
|
|
6
6
|
let $scope;
|
|
@@ -19,6 +19,7 @@ describe("ngSwitch", () => {
|
|
|
19
19
|
|
|
20
20
|
afterEach(() => {
|
|
21
21
|
dealoc(element);
|
|
22
|
+
jqLite.CACHE.clear();
|
|
22
23
|
});
|
|
23
24
|
|
|
24
25
|
it("should switch on value change", () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dealoc } from "../../src/jqLite";
|
|
1
|
+
import { dealoc, jqLite } from "../../src/jqLite";
|
|
2
2
|
import { Angular } from "../../src/loader";
|
|
3
3
|
import { publishExternalAPI } from "../../src/public";
|
|
4
4
|
import { wait } from "../test-utils";
|
|
@@ -103,7 +103,7 @@ describe("view hooks", () => {
|
|
|
103
103
|
it("can redirect the transition", async () => {
|
|
104
104
|
ctrl.prototype.uiCanExit = function (trans) {
|
|
105
105
|
log += "canexit;";
|
|
106
|
-
return
|
|
106
|
+
return $state.target("baz");
|
|
107
107
|
};
|
|
108
108
|
await initial();
|
|
109
109
|
|
package/test/router/view.spec.js
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* @packageDocumentation
|
|
6
6
|
*/
|
|
7
7
|
import { IInjectable, Obj } from "./common";
|
|
8
|
-
import { Disposable } from "../interface";
|
|
9
8
|
import { UrlConfig, UrlService } from "../url";
|
|
10
9
|
export declare const makeStub: <T>(service: string, methods: (keyof T)[]) => T;
|
|
11
10
|
declare const services: CoreServices;
|
|
@@ -46,7 +45,7 @@ export interface CoreServices {
|
|
|
46
45
|
* - [[HashLocationService]]
|
|
47
46
|
* - [[MemoryLocationService]]
|
|
48
47
|
*/
|
|
49
|
-
export interface LocationServices
|
|
48
|
+
export interface LocationServices {
|
|
50
49
|
/** See: [[UrlService.url]] */ url: UrlService["url"];
|
|
51
50
|
/** See: [[UrlService.path]] */ path: UrlService["path"];
|
|
52
51
|
/** See: [[UrlService.search]] */ search: UrlService["search"];
|
|
@@ -67,7 +66,7 @@ export interface LocationServices extends Disposable {
|
|
|
67
66
|
* - [[BrowserLocationConfig]]
|
|
68
67
|
* - [[MemoryLocationConfig]]
|
|
69
68
|
*/
|
|
70
|
-
export interface LocationConfig
|
|
69
|
+
export interface LocationConfig {
|
|
71
70
|
/** See: [[UrlConfig.port]] */ port: UrlConfig["port"];
|
|
72
71
|
/** See: [[UrlConfig.protocol]] */ protocol: UrlConfig["protocol"];
|
|
73
72
|
/** See: [[UrlConfig.host]] */ host: UrlConfig["host"];
|
|
@@ -3,14 +3,12 @@ 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
|
-
import { Disposable } from "./interface";
|
|
7
|
-
/**
|
|
8
6
|
* Global router state
|
|
9
7
|
*
|
|
10
8
|
* This is where we hold the global mutable state such as current state, current
|
|
11
9
|
* params, current transition, etc.
|
|
12
10
|
*/
|
|
13
|
-
export declare class UIRouterGlobals
|
|
11
|
+
export declare class UIRouterGlobals {
|
|
14
12
|
/**
|
|
15
13
|
* Current parameter values
|
|
16
14
|
*
|
|
@@ -41,5 +39,4 @@ export declare class UIRouterGlobals implements Disposable {
|
|
|
41
39
|
transitionHistory: Queue<Transition>;
|
|
42
40
|
/** @internal */
|
|
43
41
|
successfulTransitions: Queue<Transition>;
|
|
44
|
-
dispose(): void;
|
|
45
42
|
}
|
|
@@ -89,16 +89,10 @@ export interface UIInjector {
|
|
|
89
89
|
getNative(token: any): any;
|
|
90
90
|
getNative<T>(token: any): T;
|
|
91
91
|
}
|
|
92
|
-
export interface UIRouterPlugin
|
|
92
|
+
export interface UIRouterPlugin {
|
|
93
93
|
name: string;
|
|
94
94
|
}
|
|
95
|
-
export declare abstract class UIRouterPluginBase
|
|
96
|
-
implements UIRouterPlugin, Disposable
|
|
97
|
-
{
|
|
95
|
+
export declare abstract class UIRouterPluginBase implements UIRouterPlugin {
|
|
98
96
|
abstract name: string;
|
|
99
97
|
dispose(router: UIRouter): void;
|
|
100
98
|
}
|
|
101
|
-
export interface Disposable {
|
|
102
|
-
/** Instructs the Disposable to clean up any resources */
|
|
103
|
-
dispose(router?: UIRouter): any;
|
|
104
|
-
}
|
|
@@ -5,7 +5,7 @@ import { ViewService } from "./view/view";
|
|
|
5
5
|
import { StateRegistry } from "./state/stateRegistry";
|
|
6
6
|
import { StateService } from "./state/stateService";
|
|
7
7
|
import { UIRouterGlobals } from "./globals";
|
|
8
|
-
import { UIRouterPlugin
|
|
8
|
+
import { UIRouterPlugin } from "./interface";
|
|
9
9
|
import { UrlService } from "./url/urlService";
|
|
10
10
|
import { LocationServices, LocationConfig } from "./common/coreservices";
|
|
11
11
|
import { Trace } from "./common/trace";
|
|
@@ -46,8 +46,7 @@ export declare class UIRouter {
|
|
|
46
46
|
stateService: StateService;
|
|
47
47
|
/** @internal plugin instances are registered here */
|
|
48
48
|
private _plugins;
|
|
49
|
-
|
|
50
|
-
disposable(disposable: Disposable): void;
|
|
49
|
+
|
|
51
50
|
/**
|
|
52
51
|
* Disposes this router instance
|
|
53
52
|
*
|
|
@@ -2,9 +2,8 @@ import { _StateDeclaration } from "./interface";
|
|
|
2
2
|
import { StateObject } from "./stateObject";
|
|
3
3
|
import { StateBuilder } from "./stateBuilder";
|
|
4
4
|
import { StateRegistryListener } from "./stateRegistry";
|
|
5
|
-
import { Disposable } from "../interface";
|
|
6
5
|
import { UIRouter } from "../router";
|
|
7
|
-
export declare class StateQueueManager
|
|
6
|
+
export declare class StateQueueManager {
|
|
8
7
|
private router;
|
|
9
8
|
states: {
|
|
10
9
|
[key: string]: StateObject;
|
|
@@ -20,7 +19,6 @@ export declare class StateQueueManager implements Disposable {
|
|
|
20
19
|
builder: StateBuilder,
|
|
21
20
|
listeners: StateRegistryListener[],
|
|
22
21
|
);
|
|
23
|
-
dispose(): void;
|
|
24
22
|
register(stateDecl: _StateDeclaration): StateObject;
|
|
25
23
|
flush(): {
|
|
26
24
|
[key: string]: StateObject;
|
|
@@ -53,8 +53,7 @@ export declare class StateService {
|
|
|
53
53
|
$current: StateObject;
|
|
54
54
|
/** @internal */
|
|
55
55
|
constructor(/** @internal */ router: UIRouter);
|
|
56
|
-
|
|
57
|
-
dispose(): void;
|
|
56
|
+
|
|
58
57
|
/**
|
|
59
58
|
* Handler for when [[transitionTo]] is called with an invalid state.
|
|
60
59
|
*
|
|
@@ -327,7 +327,7 @@ export interface IHookRegistry {
|
|
|
327
327
|
* ```js
|
|
328
328
|
* // ng2
|
|
329
329
|
* transitionService.onBefore({ to: 'home' }, (trans: Transition) =>
|
|
330
|
-
*
|
|
330
|
+
* stateService.target("home.dashboard"));
|
|
331
331
|
* ```
|
|
332
332
|
*
|
|
333
333
|
* #### Data Driven Default Substate
|
|
@@ -354,7 +354,7 @@ export interface IHookRegistry {
|
|
|
354
354
|
*
|
|
355
355
|
* $transitions.onBefore(criteria, function(trans: Transition) {
|
|
356
356
|
* var substate = trans.to().defaultSubstate;
|
|
357
|
-
* return
|
|
357
|
+
* return stateService.target(substate);
|
|
358
358
|
* });
|
|
359
359
|
* ```
|
|
360
360
|
*
|
|
@@ -429,7 +429,7 @@ export interface IHookRegistry {
|
|
|
429
429
|
* ```js
|
|
430
430
|
* // ng1
|
|
431
431
|
* $transitions.onStart( { to: 'auth.**' }, function(trans) {
|
|
432
|
-
* var $state =
|
|
432
|
+
* var $state = stateService;
|
|
433
433
|
* var MyAuthService = trans.injector().get('MyAuthService');
|
|
434
434
|
*
|
|
435
435
|
* // If the user is not authenticated
|
|
@@ -20,7 +20,6 @@ import { ViewService } from "../view/view";
|
|
|
20
20
|
import { UIRouter } from "../router";
|
|
21
21
|
import { TransitionEventType } from "./transitionEventType";
|
|
22
22
|
import { GetResultHandler, GetErrorHandler } from "./transitionHook";
|
|
23
|
-
import { Disposable } from "../interface";
|
|
24
23
|
/**
|
|
25
24
|
* The default [[Transition]] options.
|
|
26
25
|
*
|
|
@@ -82,7 +81,7 @@ export interface TransitionServicePluginAPI {
|
|
|
82
81
|
*
|
|
83
82
|
* This API is located at `router.transitionService` ([[UIRouter.transitionService]])
|
|
84
83
|
*/
|
|
85
|
-
export declare class TransitionService implements IHookRegistry
|
|
84
|
+
export declare class TransitionService implements IHookRegistry {
|
|
86
85
|
/** @internal */
|
|
87
86
|
_transitionCount: number;
|
|
88
87
|
/** @internal */
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Disposable } from "../interface";
|
|
2
1
|
import { UIRouter } from "../router";
|
|
3
2
|
import { ParamTypeDefinition, ParamTypes } from "../params";
|
|
4
3
|
/**
|
|
@@ -14,7 +13,7 @@ import { ParamTypeDefinition, ParamTypes } from "../params";
|
|
|
14
13
|
*
|
|
15
14
|
* This API is found at `router.urlService.config` (see: [[UIRouter.urlService]], [[URLService.config]])
|
|
16
15
|
*/
|
|
17
|
-
export declare class UrlConfig
|
|
16
|
+
export declare class UrlConfig {
|
|
18
17
|
private router;
|
|
19
18
|
/** @internal */ paramTypes: ParamTypes;
|
|
20
19
|
/** @internal */ _decodeParams: boolean;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { UIRouter } from "../router";
|
|
2
|
-
import { Disposable } from "../interface";
|
|
3
2
|
import { UrlRule, UrlRuleHandlerFn } from "./interface";
|
|
4
3
|
import { TargetState, TargetStateDef } from "../state";
|
|
5
4
|
import { UrlMatcher } from "./urlMatcher";
|
|
@@ -14,7 +13,7 @@ import { UrlRuleFactory } from "./urlRule";
|
|
|
14
13
|
*
|
|
15
14
|
* This API is found at `router.urlService.rules` (see: [[UIRouter.urlService]], [[URLService.rules]])
|
|
16
15
|
*/
|
|
17
|
-
export declare class UrlRules
|
|
16
|
+
export declare class UrlRules {
|
|
18
17
|
private router;
|
|
19
18
|
/** used to create [[UrlRule]] objects for common cases */
|
|
20
19
|
urlRuleFactory: UrlRuleFactory;
|
|
@@ -35,7 +35,6 @@ export declare class Ng1LocationServices
|
|
|
35
35
|
* @param router
|
|
36
36
|
*/
|
|
37
37
|
static monkeyPatchPathParameterType(router: UIRouter): void;
|
|
38
|
-
dispose(): void;
|
|
39
38
|
constructor($locationProvider: ILocationProvider);
|
|
40
39
|
onChange(callback: Function): () => Function[];
|
|
41
40
|
html5Mode(): any;
|