@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.
Files changed (73) hide show
  1. package/README.md +1 -2
  2. package/dist/angular-ts.esm.js +1 -1
  3. package/dist/angular-ts.umd.js +1 -1
  4. package/e2e/unit.spec.ts +2 -1
  5. package/index.html +8 -9
  6. package/package.json +1 -1
  7. package/src/core/pubsub.js +329 -0
  8. package/src/router/hooks/core-resolvables.js +12 -11
  9. package/src/router/hooks/ignored-transition.js +1 -1
  10. package/src/router/hooks/lazy-load.js +40 -41
  11. package/src/router/hooks/redirect-to.js +32 -29
  12. package/src/router/hooks/update-globals.js +1 -1
  13. package/src/router/hooks/url.js +33 -24
  14. package/src/router/hooks/views.js +21 -20
  15. package/src/router/params/param-factory.js +17 -0
  16. package/src/router/router.js +74 -10
  17. package/src/router/state/state-queue-manager.js +5 -4
  18. package/src/router/state/state-registry.js +8 -5
  19. package/src/router/state/state-service.js +34 -29
  20. package/src/router/transition/hook-builder.js +2 -2
  21. package/src/router/transition/transition-hook.js +2 -1
  22. package/src/router/transition/transition-service.js +12 -18
  23. package/src/router/transition/transition.js +28 -25
  24. package/src/router/url/url-config.js +1 -49
  25. package/src/router/url/url-matcher-factory.js +10 -51
  26. package/src/router/url/url-router.js +27 -17
  27. package/src/router/url/url-rule.js +9 -13
  28. package/src/router/url/url-rules.js +3 -3
  29. package/src/router/url/url-service.js +22 -18
  30. package/src/router/view/view.js +3 -3
  31. package/src/shared/hof.js +1 -1
  32. package/test/angular.spec.js +1 -0
  33. package/test/aria/aria.spec.js +2 -1
  34. package/test/core/pubsub.spec.js +314 -0
  35. package/test/directive/bind.spec.js +2 -1
  36. package/test/directive/boolean.spec.js +4 -2
  37. package/test/directive/change.spec.js +1 -1
  38. package/test/directive/class.spec.js +1 -0
  39. package/test/directive/click.spec.js +2 -1
  40. package/test/directive/cloak.spec.js +1 -2
  41. package/test/directive/{constoller.spec.js → controller.spec.js} +1 -0
  42. package/test/directive/element-style.spec.js +1 -0
  43. package/test/directive/event.spec.js +1 -1
  44. package/test/directive/href.spec.js +2 -1
  45. package/test/directive/init.spec.js +1 -0
  46. package/test/directive/input.spec.js +200 -285
  47. package/test/directive/list.spec.js +2 -1
  48. package/test/directive/model.spec.js +1 -0
  49. package/test/directive/non-bindable.spec.js +2 -1
  50. package/test/directive/script.spec.js +1 -0
  51. package/test/directive/scrset.spec.js +2 -1
  52. package/test/directive/show-hide.spec.js +1 -0
  53. package/test/directive/src.spec.js +2 -1
  54. package/test/directive/style.spec.js +1 -0
  55. package/test/directive/switch.spec.js +2 -1
  56. package/test/directive/validators.spec.js +1 -1
  57. package/test/router/view-hook.spec.js +2 -2
  58. package/test/router/view-scroll.spec.js +1 -1
  59. package/test/router/view.spec.js +1 -1
  60. package/types/router/core/common/coreservices.d.ts +2 -3
  61. package/types/router/core/globals.d.ts +1 -4
  62. package/types/router/core/interface.d.ts +2 -8
  63. package/types/router/core/params/paramTypes.d.ts +0 -1
  64. package/types/router/core/router.d.ts +2 -3
  65. package/types/router/core/state/stateQueueManager.d.ts +1 -3
  66. package/types/router/core/state/stateRegistry.d.ts +0 -2
  67. package/types/router/core/state/stateService.d.ts +1 -2
  68. package/types/router/core/transition/interface.d.ts +3 -3
  69. package/types/router/core/transition/transitionService.d.ts +1 -2
  70. package/types/router/core/url/urlConfig.d.ts +1 -2
  71. package/types/router/core/url/urlRules.d.ts +1 -2
  72. package/types/router/core/url/urlService.d.ts +1 -2
  73. 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) {
@@ -52,6 +52,7 @@ describe("ngModel", () => {
52
52
 
53
53
  afterEach(() => {
54
54
  dealoc(element);
55
+ jqLite.CACHE.clear();
55
56
  });
56
57
 
57
58
  describe("NgModelController", () => {
@@ -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", () => {
@@ -21,6 +21,7 @@ describe("scriptDirective", () => {
21
21
 
22
22
  afterEach(() => {
23
23
  dealoc(element);
24
+ jqLite.CACHE.clear();
24
25
  });
25
26
 
26
27
  it("should populate $templateCache with contents of a ng-template script element", () => {
@@ -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", () => {
@@ -17,6 +17,7 @@ describe("ngShow / ngHide", () => {
17
17
 
18
18
  afterEach(() => {
19
19
  dealoc(element);
20
+ jqLite.CACHE.clear();
20
21
  });
21
22
 
22
23
  describe("ngShow", () => {
@@ -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]", () => {
@@ -17,6 +17,7 @@ describe("ng-style", () => {
17
17
 
18
18
  afterEach(() => {
19
19
  dealoc(element);
20
+ jqLite.CACHE.clear();
20
21
  });
21
22
 
22
23
  it("should set", () => {
@@ -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,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("validators", () => {
6
6
  let $rootScope;
@@ -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 trans.router.stateService.target("baz");
106
+ return $state.target("baz");
107
107
  };
108
108
  await initial();
109
109
 
@@ -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";
@@ -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 { curry } from "../../src/shared/hof";
@@ -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 extends Disposable {
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 extends Disposable {
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 implements Disposable {
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 extends Disposable {
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
- }
@@ -179,7 +179,6 @@ export declare class ParamTypes {
179
179
  typeQueue: any[];
180
180
  private defaultTypes;
181
181
  constructor();
182
- dispose(): void;
183
182
  /**
184
183
  * Registers a parameter type
185
184
  *
@@ -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, Disposable } from "./interface";
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
- /** Registers an object to be notified when the router is disposed */
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 implements Disposable {
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;
@@ -37,8 +37,6 @@ export declare class StateRegistry {
37
37
  constructor(router: UIRouter);
38
38
  /** @internal */
39
39
  private _registerRoot;
40
- /** @internal */
41
- dispose(): void;
42
40
  /**
43
41
  * Listen for a State Registry events
44
42
  *
@@ -53,8 +53,7 @@ export declare class StateService {
53
53
  $current: StateObject;
54
54
  /** @internal */
55
55
  constructor(/** @internal */ router: UIRouter);
56
- /** @internal */
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
- * trans.router.stateService.target("home.dashboard"));
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 trans.router.stateService.target(substate);
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 = trans.router.stateService;
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, Disposable {
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 implements Disposable {
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 implements Disposable {
16
+ export declare class UrlRules {
18
17
  private router;
19
18
  /** used to create [[UrlRule]] objects for common cases */
20
19
  urlRuleFactory: UrlRuleFactory;
@@ -24,8 +24,7 @@ export declare class UrlService implements LocationServices, UrlSyncApi {
24
24
  config: UrlConfig;
25
25
  /** @internal */
26
26
  constructor(/** @internal */ router: UIRouter);
27
- /** @internal */
28
- dispose(): void;
27
+
29
28
  /**
30
29
  * Gets the current URL parts
31
30
  *
@@ -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;