@angular-wave/angular.ts 0.0.28 → 0.0.29

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 (47) hide show
  1. package/dist/angular-ts.esm.js +1 -1
  2. package/dist/angular-ts.umd.js +1 -1
  3. package/index.html +6 -5
  4. package/package.json +1 -1
  5. package/src/router/common/trace.js +6 -6
  6. package/src/router/directives/state-directives.js +74 -74
  7. package/src/router/directives/view-directive.js +21 -21
  8. package/src/router/index.js +12 -12
  9. package/src/router/injectables.js +3 -3
  10. package/src/router/router.js +7 -6
  11. package/src/router/services.js +4 -8
  12. package/src/router/state/state-builder.js +1 -0
  13. package/src/router/state/state-registry.js +55 -2
  14. package/src/router/state/state-service.js +16 -25
  15. package/src/router/state/views.js +4 -4
  16. package/src/router/state-filters.js +0 -2
  17. package/src/router/state-provider.js +0 -2
  18. package/src/router/template-factory.js +4 -4
  19. package/src/router/transition/transition-service.js +2 -3
  20. package/src/router/url/url-router.js +4 -0
  21. package/src/router/view/view.js +65 -65
  22. package/src/services/browser.js +1 -5
  23. package/test/core/pubsub.spec.js +73 -0
  24. package/test/module-test.html +5 -5
  25. package/test/original-test.html +3 -3
  26. package/test/router/services.spec.js +1 -1
  27. package/test/router/state-directives.spec.js +72 -80
  28. package/test/router/state-filter.spec.js +6 -4
  29. package/test/router/state.spec.js +15 -13
  30. package/test/router/template-factory.spec.js +4 -4
  31. package/test/router/url-matcher-factory.spec.js +2 -2
  32. package/test/router/view-directive.spec.js +165 -163
  33. package/test/router/view-hook.spec.js +2 -2
  34. package/test/router/view-scroll.spec.js +14 -14
  35. package/test/router/view.spec.js +2 -2
  36. package/types/router/core/state/interface.d.ts +6 -6
  37. package/types/router/core/state/stateRegistry.d.ts +1 -0
  38. package/types/router/core/state/stateService.d.ts +4 -4
  39. package/types/router/core/transition/interface.d.ts +1 -1
  40. package/types/router/core/view/interface.d.ts +2 -2
  41. package/types/router/core/view/view.d.ts +16 -16
  42. package/types/router/directives/viewDirective.d.ts +3 -3
  43. package/types/router/interface.d.ts +4 -4
  44. package/types/router/stateProvider.d.ts +3 -3
  45. package/types/router/statebuilders/views.d.ts +1 -1
  46. package/types/router/templateFactory.d.ts +2 -2
  47. package/types/router/viewScroll.d.ts +1 -1
package/index.html CHANGED
@@ -16,7 +16,7 @@
16
16
 
17
17
  <!-- <script src="dist/angular-ts.umd.js"></script> -->
18
18
  <!-- include spec files here... -->
19
-
19
+
20
20
  <script type="module" src="test/directive/boolean.spec.js"></script>
21
21
  <script type="module" src="test/directive/form.spec.js"></script>
22
22
  <script type="module" src="test/directive/input.spec.js"></script>
@@ -26,7 +26,7 @@
26
26
  <script type="module" src="test/directive/click.spec.js"></script>
27
27
  <script type="module" src="test/directive/cloak.spec.js"></script>
28
28
  <script type="module" src="test/directive/controller.spec.js"></script>
29
- <!-- <script type="module" src="test/directive/event.spec.js"></script>
29
+ <script type="module" src="test/directive/event.spec.js"></script>
30
30
  <script type="module" src="test/directive/href.spec.js"></script>
31
31
  <script type="module" src="test/directive/if.spec.js"></script>
32
32
  <script type="module" src="test/directive/include.spec.js"></script>
@@ -70,6 +70,7 @@
70
70
  <script type="module" src="test/core/on.spec.js"></script>
71
71
  <script type="module" src="test/core/prop.spec.js"></script>
72
72
  <script type="module" src="test/core/parse.spec.js"></script>
73
+ <script type="module" src="test/core/pubsub.spec.js"></script>
73
74
  <script type="module" src="test/core/q.spec.js"></script>
74
75
  <script type="module" src="test/core/root-element.spec.js"></script>
75
76
 
@@ -95,8 +96,8 @@
95
96
  <script type="module" src="test/shared/common.spec.js"></script>
96
97
  <script type="module" src="test/shared/hof.spec.js"></script>
97
98
  <script type="module" src="test/shared/strings.spec.js"></script>
98
- <script type="module" src="test/shared/utils.spec.js"></script>-->
99
- <!-- <script type="module" src="test/core/pubsub.spec.js"></script>
99
+ <script type="module" src="test/shared/utils.spec.js"></script>
100
+
100
101
  <script type="module" src="test/router/glob.spec.js"></script>
101
102
  <script type="module" src="test/router/services.spec.js"></script>
102
103
  <script type="module" src="test/router/state-directives.spec.js"></script>
@@ -107,7 +108,7 @@
107
108
  <script type="module" src="test/router/view-directive.spec.js"></script>
108
109
  <script type="module" src="test/router/view-hook.spec.js"></script>
109
110
  <script type="module" src="test/router/view-scroll.spec.js"></script>
110
- <script type="module" src="test/router/view.spec.js"></script> -->
111
+ <script type="module" src="test/router/view.spec.js"></script>
111
112
 
112
113
 
113
114
  <!-- <script type="module" src="test/core/interval.spec.js"></script>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@angular-wave/angular.ts",
3
3
  "license": "MIT",
4
- "version": "0.0.28",
4
+ "version": "0.0.29",
5
5
  "type": "module",
6
6
  "main": "dist/angular-ts.esm.js",
7
7
  "browser": "dist/angular-ts.umd.js",
@@ -40,7 +40,7 @@ import {
40
40
  maxLength,
41
41
  padString,
42
42
  } from "../../shared/strings";
43
- function uiViewString(uiview) {
43
+ function ngViewString(uiview) {
44
44
  if (!uiview) return "ui-view (defunct)";
45
45
  const state = uiview.creationContext
46
46
  ? uiview.creationContext.name || "(root)"
@@ -50,7 +50,7 @@ function uiViewString(uiview) {
50
50
  const viewConfigString = (viewConfig) => {
51
51
  const view = viewConfig.viewDecl;
52
52
  const state = view.$context.name || "(root)";
53
- return `[View#${viewConfig.$id} from '${state}' state]: target ui-view: '${view.$uiViewName}@${view.$uiViewContextAnchor}'`;
53
+ return `[View#${viewConfig.$id} from '${state}' state]: target ui-view: '${view.$ngViewName}@${view.$ngViewContextAnchor}'`;
54
54
  };
55
55
  function normalizedCat(input) {
56
56
  return isNumber(input) ? Category[input] : Category[Category[input]];
@@ -178,7 +178,7 @@ export class Trace {
178
178
  traceUIViewEvent(event, viewData, extra = "") {
179
179
  if (!this.enabled(Category.UIVIEW)) return;
180
180
  console.log(
181
- `ui-view: ${padString(30, event)} ${uiViewString(viewData)}${extra}`,
181
+ `ui-view: ${padString(30, event)} ${ngViewString(viewData)}${extra}`,
182
182
  );
183
183
  }
184
184
  /** @internal called by ui-router code */
@@ -201,8 +201,8 @@ export class Trace {
201
201
  const uivheader = "uiview component fqn";
202
202
  const cfgheader = "view config state (view name)";
203
203
  const mapping = pairs
204
- .map(({ uiView, viewConfig }) => {
205
- const uiv = uiView && uiView.fqn;
204
+ .map(({ ngView, viewConfig }) => {
205
+ const uiv = ngView && ngView.fqn;
206
206
  const cfg =
207
207
  viewConfig &&
208
208
  `${viewConfig.viewDecl.$context.name}: (${viewConfig.viewDecl.$name})`;
@@ -219,7 +219,7 @@ export class Trace {
219
219
  /** @internal called by ui-router code */
220
220
  traceViewServiceUIViewEvent(event, viewData) {
221
221
  if (!this.enabled(Category.VIEWCONFIG)) return;
222
- console.log(`VIEWCONFIG: ${event} ${uiViewString(viewData)}`);
222
+ console.log(`VIEWCONFIG: ${event} ${ngViewString(viewData)}`);
223
223
  }
224
224
  }
225
225
  /**
@@ -29,19 +29,19 @@ function parseStateRef(ref) {
29
29
  }
30
30
  /** @hidden */
31
31
  function stateContext(el) {
32
- const $uiView = el.parent().inheritedData("$uiView");
33
- const path = parse("$cfg.path")($uiView);
32
+ const $ngView = el.parent().inheritedData("$ngView");
33
+ const path = parse("$cfg.path")($ngView);
34
34
  return path ? tail(path).state.name : undefined;
35
35
  }
36
36
  /** @hidden */
37
37
  function processedDef($state, $element, def) {
38
- const uiState = def.uiState || $state.current.name;
39
- const uiStateOpts = Object.assign(
38
+ const ngState = def.ngState || $state.current.name;
39
+ const ngStateOpts = Object.assign(
40
40
  defaultOpts($element, $state),
41
- def.uiStateOpts || {},
41
+ def.ngStateOpts || {},
42
42
  );
43
- const href = $state.href(uiState, def.uiStateParams, uiStateOpts);
44
- return { uiState, uiStateParams: def.uiStateParams, uiStateOpts, href };
43
+ const href = $state.href(ngState, def.ngStateParams, ngStateOpts);
44
+ return { ngState, ngStateParams: def.ngStateParams, ngStateOpts, href };
45
45
  }
46
46
  /** @hidden */
47
47
  function getTypeInfo(el) {
@@ -73,7 +73,7 @@ function clickHook(el, $state, $timeout, type, getDef) {
73
73
  // HACK: This is to allow ng-clicks to be processed before the transition is initiated:
74
74
  const transition = $timeout(function () {
75
75
  if (!el.attr("disabled")) {
76
- $state.go(target.uiState, target.uiStateParams, target.uiStateOpts);
76
+ $state.go(target.ngState, target.ngStateParams, target.ngStateOpts);
77
77
  }
78
78
  });
79
79
  e.preventDefault();
@@ -98,10 +98,10 @@ function defaultOpts(el, $state) {
98
98
  };
99
99
  }
100
100
  /** @hidden */
101
- function bindEvents(element, scope, hookFn, uiStateOpts) {
101
+ function bindEvents(element, scope, hookFn, ngStateOpts) {
102
102
  let events;
103
- if (uiStateOpts) {
104
- events = uiStateOpts.events;
103
+ if (ngStateOpts) {
104
+ events = ngStateOpts.events;
105
105
  }
106
106
  if (!Array.isArray(events)) {
107
107
  events = ["click"];
@@ -196,7 +196,7 @@ function bindEvents(element, scope, hookFn, uiStateOpts) {
196
196
  * ```
197
197
  *
198
198
  * ### Highlighting the active link
199
- * This directive can be used in conjunction with [[uiSrefActive]] to highlight the active link.
199
+ * This directive can be used in conjunction with [[ngSrefActive]] to highlight the active link.
200
200
  *
201
201
  * ### Examples
202
202
  * If you have the following template:
@@ -248,34 +248,34 @@ function bindEvents(element, scope, hookFn, uiStateOpts) {
248
248
  * - A middle-click, right-click, or ctrl-click is handled (natively) by the browser to open the href in a new window, for example.
249
249
  *
250
250
  * - Unlike the parameter values expression, the state name is not `$watch`ed (for performance reasons).
251
- * If you need to dynamically update the state being linked to, use the fully dynamic [[uiState]] directive.
251
+ * If you need to dynamically update the state being linked to, use the fully dynamic [[ngState]] directive.
252
252
  */
253
- export let uiSrefDirective = [
253
+ export let ngSrefDirective = [
254
254
  "$router",
255
255
  "$timeout",
256
256
  function $StateRefDirective($router, $timeout) {
257
257
  const $state = $router.stateService;
258
258
  return {
259
259
  restrict: "A",
260
- require: ["?^uiSrefActive", "?^uiSrefActiveEq"],
261
- link: (scope, element, attrs, uiSrefActive) => {
260
+ require: ["?^ngSrefActive", "?^ngSrefActiveEq"],
261
+ link: (scope, element, attrs, ngSrefActive) => {
262
262
  const type = getTypeInfo(element);
263
- const active = uiSrefActive[1] || uiSrefActive[0];
263
+ const active = ngSrefActive[1] || ngSrefActive[0];
264
264
  let unlinkInfoFn = null;
265
265
  const rawDef = {};
266
266
  const getDef = () => processedDef($state, element, rawDef);
267
- const ref = parseStateRef(attrs.uiSref);
268
- rawDef.uiState = ref.state;
269
- rawDef.uiStateOpts = attrs.uiSrefOpts
270
- ? scope.$eval(attrs.uiSrefOpts)
267
+ const ref = parseStateRef(attrs.ngSref);
268
+ rawDef.ngState = ref.state;
269
+ rawDef.ngStateOpts = attrs.ngSrefOpts
270
+ ? scope.$eval(attrs.ngSrefOpts)
271
271
  : {};
272
272
  function update() {
273
273
  const def = getDef();
274
274
  if (unlinkInfoFn) unlinkInfoFn();
275
275
  if (active)
276
276
  unlinkInfoFn = active.$$addStateInfo(
277
- def.uiState,
278
- def.uiStateParams,
277
+ def.ngState,
278
+ def.ngStateParams,
279
279
  );
280
280
  if (def.href != null) attrs.$set(type.attr, def.href);
281
281
  }
@@ -283,123 +283,123 @@ export let uiSrefDirective = [
283
283
  scope.$watch(
284
284
  ref.paramExpr,
285
285
  function (val) {
286
- rawDef.uiStateParams = Object.assign({}, val);
286
+ rawDef.ngStateParams = Object.assign({}, val);
287
287
  update();
288
288
  },
289
289
  true,
290
290
  );
291
- rawDef.uiStateParams = Object.assign({}, scope.$eval(ref.paramExpr));
291
+ rawDef.ngStateParams = Object.assign({}, scope.$eval(ref.paramExpr));
292
292
  }
293
293
  update();
294
294
  scope.$on("$destroy", $router.stateRegistry.onStatesChanged(update));
295
295
  scope.$on("$destroy", $router.transitionService.onSuccess({}, update));
296
296
  if (!type.clickable) return;
297
297
  const hookFn = clickHook(element, $state, $timeout, type, getDef);
298
- bindEvents(element, scope, hookFn, rawDef.uiStateOpts);
298
+ bindEvents(element, scope, hookFn, rawDef.ngStateOpts);
299
299
  },
300
300
  };
301
301
  },
302
302
  ];
303
303
  /**
304
- * `ui-state`: A fully dynamic directive for linking to a state
304
+ * `ng-state`: A fully dynamic directive for linking to a state
305
305
  *
306
306
  * A directive which links to a state (and optionally, parameters).
307
307
  * When clicked, this directive activates the linked state with the supplied parameter values.
308
308
  *
309
- * **This directive is very similar to [[uiSref]], but it `$observe`s and `$watch`es/evaluates all its inputs.**
309
+ * **This directive is very similar to [[ngSref]], but it `$observe`s and `$watch`es/evaluates all its inputs.**
310
310
  *
311
311
  * A directive which links to a state (and optionally, parameters).
312
312
  * When clicked, this directive activates the linked state with the supplied parameter values.
313
313
  *
314
314
  * ### Linked State
315
- * The attribute value of `ui-state` is an expression which is `$watch`ed and evaluated as the state to link to.
315
+ * The attribute value of `ng-state` is an expression which is `$watch`ed and evaluated as the state to link to.
316
316
  * **This is in contrast with `ui-sref`, which takes a state name as a string literal.**
317
317
  *
318
318
  * #### Example:
319
319
  * Create a list of links.
320
320
  * ```html
321
321
  * <li ng-repeat="link in navlinks">
322
- * <a ui-state="link.state">{{ link.displayName }}</a>
322
+ * <a ng-state="link.state">{{ link.displayName }}</a>
323
323
  * </li>
324
324
  * ```
325
325
  *
326
326
  * ### Relative Links
327
- * If the expression evaluates to a relative path, it is processed like [[uiSref]].
327
+ * If the expression evaluates to a relative path, it is processed like [[ngSref]].
328
328
  * You just need to be aware that the path is relative to the state that *created* the link.
329
- * This allows a state to create relative `ui-state` which always targets the same destination.
329
+ * This allows a state to create relative `ng-state` which always targets the same destination.
330
330
  *
331
331
  * ### hrefs
332
332
  * If the linked state has a URL, the directive will automatically generate and
333
333
  * update the `href` attribute (using the [[StateService.href]] method).
334
334
  *
335
335
  * ### Parameter Values
336
- * In addition to the state name expression, a `ui-state` can include parameter values which are applied when activating the state.
337
- * Param values should be provided using the `ui-state-params` attribute.
338
- * The `ui-state-params` attribute value is `$watch`ed and evaluated as an expression.
336
+ * In addition to the state name expression, a `ng-state` can include parameter values which are applied when activating the state.
337
+ * Param values should be provided using the `ng-state-params` attribute.
338
+ * The `ng-state-params` attribute value is `$watch`ed and evaluated as an expression.
339
339
  *
340
340
  * #### Example:
341
341
  * This example renders a list of links with param values.
342
342
  * The state's `userId` parameter value comes from each user's `user.id` property.
343
343
  * ```html
344
344
  * <li ng-repeat="link in navlinks">
345
- * <a ui-state="link.state" ui-state-params="link.params">{{ link.displayName }}</a>
345
+ * <a ng-state="link.state" ng-state-params="link.params">{{ link.displayName }}</a>
346
346
  * </li>
347
347
  * ```
348
348
  *
349
349
  * ### Transition Options
350
- * You can specify [[TransitionOptions]] to pass to [[StateService.go]] by using the `ui-state-opts` attribute.
350
+ * You can specify [[TransitionOptions]] to pass to [[StateService.go]] by using the `ng-state-opts` attribute.
351
351
  * Options are restricted to `location`, `inherit`, and `reload`.
352
- * The value of the `ui-state-opts` is `$watch`ed and evaluated as an expression.
352
+ * The value of the `ng-state-opts` is `$watch`ed and evaluated as an expression.
353
353
  *
354
354
  * #### Example:
355
355
  * ```html
356
- * <a ui-state="returnto.state" ui-state-opts="{ reload: true }">Home</a>
356
+ * <a ng-state="returnto.state" ng-state-opts="{ reload: true }">Home</a>
357
357
  * ```
358
358
  *
359
359
  * ### Other DOM Events
360
360
  *
361
361
  * You can also customize which DOM events to respond to (instead of `click`) by
362
- * providing an `events` array in the `ui-state-opts` attribute.
362
+ * providing an `events` array in the `ng-state-opts` attribute.
363
363
  *
364
364
  * #### Example:
365
365
  * ```html
366
- * <input type="text" ui-state="contacts" ui-state-opts="{ events: ['change', 'blur'] }">
366
+ * <input type="text" ng-state="contacts" ng-state-opts="{ events: ['change', 'blur'] }">
367
367
  * ```
368
368
  *
369
369
  * ### Highlighting the active link
370
- * This directive can be used in conjunction with [[uiSrefActive]] to highlight the active link.
370
+ * This directive can be used in conjunction with [[ngSrefActive]] to highlight the active link.
371
371
  *
372
372
  * ### Notes
373
373
  *
374
- * - You can use `ui-params` to change **only the parameter values** by omitting the state name and supplying only `ui-state-params`.
375
- * However, it might be simpler to use [[uiSref]] parameter-only links.
374
+ * - You can use `ui-params` to change **only the parameter values** by omitting the state name and supplying only `ng-state-params`.
375
+ * However, it might be simpler to use [[ngSref]] parameter-only links.
376
376
  *
377
377
  * #### Example:
378
378
  * Sets the `lang` parameter to `en` and remains on the same state.
379
379
  *
380
380
  * ```html
381
- * <a ui-state="" ui-state-params="{ lang: 'en' }">English</a>
381
+ * <a ng-state="" ng-state-params="{ lang: 'en' }">English</a>
382
382
  * ```
383
383
  *
384
384
  * - A middle-click, right-click, or ctrl-click is handled (natively) by the browser to open the href in a new window, for example.
385
385
  * ```
386
386
  */
387
- export let uiStateDirective = [
387
+ export let ngStateDirective = [
388
388
  "$router",
389
389
  "$timeout",
390
390
  function $StateRefDynamicDirective($router, $timeout) {
391
391
  const $state = $router.stateService;
392
392
  return {
393
393
  restrict: "A",
394
- require: ["?^uiSrefActive", "?^uiSrefActiveEq"],
395
- link: function (scope, element, attrs, uiSrefActive) {
394
+ require: ["?^ngSrefActive", "?^ngSrefActiveEq"],
395
+ link: function (scope, element, attrs, ngSrefActive) {
396
396
  const type = getTypeInfo(element);
397
- const active = uiSrefActive[1] || uiSrefActive[0];
397
+ const active = ngSrefActive[1] || ngSrefActive[0];
398
398
  let unlinkInfoFn = null;
399
399
  let hookFn;
400
400
  const rawDef = {};
401
401
  const getDef = () => processedDef($state, element, rawDef);
402
- const inputAttrs = ["uiState", "uiStateParams", "uiStateOpts"];
402
+ const inputAttrs = ["ngState", "ngStateParams", "ngStateOpts"];
403
403
  const watchDeregFns = inputAttrs.reduce(
404
404
  (acc, attr) => ((acc[attr] = () => {}), acc),
405
405
  {},
@@ -409,8 +409,8 @@ export let uiStateDirective = [
409
409
  if (unlinkInfoFn) unlinkInfoFn();
410
410
  if (active)
411
411
  unlinkInfoFn = active.$$addStateInfo(
412
- def.uiState,
413
- def.uiStateParams,
412
+ def.ngState,
413
+ def.ngStateParams,
414
414
  );
415
415
  if (def.href != null) attrs.$set(type.attr, def.href);
416
416
  }
@@ -433,7 +433,7 @@ export let uiStateDirective = [
433
433
  scope.$on("$destroy", $router.transitionService.onSuccess({}, update));
434
434
  if (!type.clickable) return;
435
435
  hookFn = clickHook(element, $state, $timeout, type, getDef);
436
- bindEvents(element, scope, hookFn, rawDef.uiStateOpts);
436
+ bindEvents(element, scope, hookFn, rawDef.ngStateOpts);
437
437
  },
438
438
  };
439
439
  },
@@ -441,26 +441,26 @@ export let uiStateDirective = [
441
441
  /**
442
442
  * `ui-sref-active` and `ui-sref-active-eq`: A directive that adds a CSS class when a `ui-sref` is active
443
443
  *
444
- * A directive working alongside [[uiSref]] and [[uiState]] to add classes to an element when the
444
+ * A directive working alongside [[ngSref]] and [[ngState]] to add classes to an element when the
445
445
  * related directive's state is active (and remove them when it is inactive).
446
446
  *
447
447
  * The primary use-case is to highlight the active link in navigation menus,
448
448
  * distinguishing it from the inactive menu items.
449
449
  *
450
- * ### Linking to a `ui-sref` or `ui-state`
451
- * `ui-sref-active` can live on the same element as `ui-sref`/`ui-state`, or it can be on a parent element.
452
- * If a `ui-sref-active` is a parent to more than one `ui-sref`/`ui-state`, it will apply the CSS class when **any of the links are active**.
450
+ * ### Linking to a `ui-sref` or `ng-state`
451
+ * `ui-sref-active` can live on the same element as `ui-sref`/`ng-state`, or it can be on a parent element.
452
+ * If a `ui-sref-active` is a parent to more than one `ui-sref`/`ng-state`, it will apply the CSS class when **any of the links are active**.
453
453
  *
454
454
  * ### Matching
455
455
  *
456
- * The `ui-sref-active` directive applies the CSS class when the `ui-sref`/`ui-state`'s target state **or any child state is active**.
456
+ * The `ui-sref-active` directive applies the CSS class when the `ui-sref`/`ng-state`'s target state **or any child state is active**.
457
457
  * This is a "fuzzy match" which uses [[StateService.includes]].
458
458
  *
459
- * The `ui-sref-active-eq` directive applies the CSS class when the `ui-sref`/`ui-state`'s target state is directly active (not when child states are active).
459
+ * The `ui-sref-active-eq` directive applies the CSS class when the `ui-sref`/`ng-state`'s target state is directly active (not when child states are active).
460
460
  * This is an "exact match" which uses [[StateService.is]].
461
461
  *
462
462
  * ### Parameter values
463
- * If the `ui-sref`/`ui-state` includes parameter values, the current parameter values must match the link's values for the link to be highlighted.
463
+ * If the `ui-sref`/`ng-state` includes parameter values, the current parameter values must match the link's values for the link to be highlighted.
464
464
  * This allows a list of links to the same state with different parameters to be rendered, and the correct one highlighted.
465
465
  *
466
466
  * #### Example:
@@ -530,7 +530,7 @@ export let uiStateDirective = [
530
530
  *
531
531
  * - Multiple classes may be specified in a space-separated format: `ui-sref-active='class1 class2 class3'`
532
532
  */
533
- export let uiSrefActiveDirective = [
533
+ export let ngSrefActiveDirective = [
534
534
  "$state",
535
535
  "$stateParams",
536
536
  "$interpolate",
@@ -550,32 +550,32 @@ export let uiSrefActiveDirective = [
550
550
  function ($scope, $element, $attrs) {
551
551
  let states = [];
552
552
  let activeEqClass;
553
- let uiSrefActive;
553
+ let ngSrefActive;
554
554
  // There probably isn't much point in $observing this
555
- // uiSrefActive and uiSrefActiveEq share the same directive object with some
555
+ // ngSrefActive and ngSrefActiveEq share the same directive object with some
556
556
  // slight difference in logic routing
557
557
  activeEqClass = $interpolate(
558
- $attrs.uiSrefActiveEq || "",
558
+ $attrs.ngSrefActiveEq || "",
559
559
  false,
560
560
  )($scope);
561
561
  try {
562
- uiSrefActive = $scope.$eval($attrs.uiSrefActive);
562
+ ngSrefActive = $scope.$eval($attrs.ngSrefActive);
563
563
  } catch (e) {
564
- // Do nothing. uiSrefActive is not a valid expression.
564
+ // Do nothing. ngSrefActive is not a valid expression.
565
565
  // Fall back to using $interpolate below
566
566
  }
567
- uiSrefActive =
568
- uiSrefActive ||
569
- $interpolate($attrs.uiSrefActive || "", false)($scope);
570
- setStatesFromDefinitionObject(uiSrefActive);
571
- // Allow uiSref to communicate with uiSrefActive[Equals]
567
+ ngSrefActive =
568
+ ngSrefActive ||
569
+ $interpolate($attrs.ngSrefActive || "", false)($scope);
570
+ setStatesFromDefinitionObject(ngSrefActive);
571
+ // Allow ngSref to communicate with ngSrefActive[Equals]
572
572
  this.$$addStateInfo = function (newState, newParams) {
573
573
  // we already got an explicit state provided by ui-sref-active, so we
574
574
  // shadow the one that comes from ui-sref
575
- if (isObject(uiSrefActive) && states.length > 0) {
575
+ if (isObject(ngSrefActive) && states.length > 0) {
576
576
  return;
577
577
  }
578
- const deregister = addState(newState, newParams, uiSrefActive);
578
+ const deregister = addState(newState, newParams, ngSrefActive);
579
579
  update();
580
580
  return deregister;
581
581
  };
@@ -604,7 +604,7 @@ export let uiSrefActiveDirective = [
604
604
  };
605
605
  }
606
606
  function handleStatesChanged() {
607
- setStatesFromDefinitionObject(uiSrefActive);
607
+ setStatesFromDefinitionObject(ngSrefActive);
608
608
  }
609
609
  function setStatesFromDefinitionObject(statesDefinition) {
610
610
  if (isObject(statesDefinition)) {
@@ -19,7 +19,7 @@ import { jqLite } from "../../jqLite";
19
19
  * The ui-view can be targeted in a View using the name ([[Ng1StateDeclaration.views]]).
20
20
  *
21
21
  * - `autoscroll`: an expression. When it evaluates to true, the `ui-view` will be scrolled into view when it is activated.
22
- * Uses [[$uiViewScroll]] to do the scrolling.
22
+ * Uses [[$ngViewScroll]] to do the scrolling.
23
23
  *
24
24
  * - `onload`: Expression to evaluate whenever the view updates.
25
25
  *
@@ -133,13 +133,13 @@ import { jqLite } from "../../jqLite";
133
133
  * });
134
134
  * ```
135
135
  */
136
- export let uiView = [
136
+ export let ngView = [
137
137
  "$view",
138
138
  "$animate",
139
- "$uiViewScroll",
139
+ "$ngViewScroll",
140
140
  "$interpolate",
141
141
  "$q",
142
- function $ViewDirective($view, $animate, $uiViewScroll, $interpolate, $q) {
142
+ function $ViewDirective($view, $animate, $ngViewScroll, $interpolate, $q) {
143
143
  function getRenderer() {
144
144
  return {
145
145
  enter: function (element, target, cb) {
@@ -155,7 +155,7 @@ export let uiView = [
155
155
  }
156
156
  const rootData = {
157
157
  $cfg: { viewDecl: { $context: $view._pluginapi._rootViewContext() } },
158
- $uiView: {},
158
+ $ngView: {},
159
159
  };
160
160
  const directive = {
161
161
  count: 0,
@@ -168,17 +168,17 @@ export let uiView = [
168
168
  const onloadExp = attrs["onload"] || "",
169
169
  autoScrollExp = attrs["autoscroll"],
170
170
  renderer = getRenderer(),
171
- inherited = $element.inheritedData("$uiView") || rootData,
171
+ inherited = $element.inheritedData("$ngView") || rootData,
172
172
  name =
173
- $interpolate(attrs["uiView"] || attrs["name"] || "")(scope) ||
173
+ $interpolate(attrs["ngView"] || attrs["name"] || "")(scope) ||
174
174
  "$default";
175
175
  let previousEl, currentEl, currentScope, viewConfig;
176
176
  const activeUIView = {
177
177
  $type: "ng1",
178
178
  id: directive.count++, // Global sequential ID for ui-view tags added to DOM
179
179
  name: name, // ui-view name (<div ui-view="name"></div>
180
- fqn: inherited.$uiView.fqn
181
- ? inherited.$uiView.fqn + "." + name
180
+ fqn: inherited.$ngView.fqn
181
+ ? inherited.$ngView.fqn + "." + name
182
182
  : name, // fully qualified name, describes location in DOM
183
183
  config: null, // The ViewConfig loaded (from a state.views definition)
184
184
  configUpdated: configUpdatedCallback, // Called when the matching ViewConfig changes
@@ -189,7 +189,7 @@ export let uiView = [
189
189
  );
190
190
  // Allow <ui-view name="foo"><ui-view name="bar"></ui-view></ui-view>
191
191
  // See https://github.com/angular-ui/ui-router/issues/3355
192
- const fromParentTag = parse("$uiView.creationContext")(inherited);
192
+ const fromParentTag = parse("$ngView.creationContext")(inherited);
193
193
  return fromParentTagConfig || fromParentTag;
194
194
  },
195
195
  };
@@ -204,7 +204,7 @@ export let uiView = [
204
204
  viewConfig = config;
205
205
  updateView(config);
206
206
  }
207
- $element.data("$uiView", { $uiView: activeUIView });
207
+ $element.data("$ngView", { $ngView: activeUIView });
208
208
  updateView();
209
209
  const unregister = $view.registerUIView(activeUIView);
210
210
  scope.$on("$destroy", function () {
@@ -215,7 +215,7 @@ export let uiView = [
215
215
  if (previousEl) {
216
216
  trace.traceUIViewEvent(
217
217
  "Removing (previous) el",
218
- previousEl.data("$uiView"),
218
+ previousEl.data("$ngView"),
219
219
  );
220
220
  previousEl.remove();
221
221
  previousEl = null;
@@ -226,7 +226,7 @@ export let uiView = [
226
226
  currentScope = null;
227
227
  }
228
228
  if (currentEl) {
229
- const _viewData = currentEl.data("$uiViewAnim");
229
+ const _viewData = currentEl.data("$ngViewAnim");
230
230
  trace.traceUIViewEvent("Animate out", _viewData);
231
231
  renderer.leave(currentEl, function () {
232
232
  _viewData.$$animLeave.resolve();
@@ -240,11 +240,11 @@ export let uiView = [
240
240
  const newScope = scope.$new();
241
241
  const animEnter = $q.defer(),
242
242
  animLeave = $q.defer();
243
- const $uiViewData = {
243
+ const $ngViewData = {
244
244
  $cfg: config,
245
- $uiView: activeUIView,
245
+ $ngView: activeUIView,
246
246
  };
247
- const $uiViewAnim = {
247
+ const $ngViewAnim = {
248
248
  $animEnter: animEnter.promise,
249
249
  $animLeave: animLeave.promise,
250
250
  $$animLeave: animLeave,
@@ -263,8 +263,8 @@ export let uiView = [
263
263
  */
264
264
  newScope.$emit("$viewContentLoading", name);
265
265
  const cloned = $transclude(newScope, function (clone) {
266
- clone.data("$uiViewAnim", $uiViewAnim);
267
- clone.data("$uiView", $uiViewData);
266
+ clone.data("$ngViewAnim", $ngViewAnim);
267
+ clone.data("$ngView", $ngViewData);
268
268
  renderer.enter(clone, $element, function () {
269
269
  animEnter.resolve();
270
270
  if (currentScope)
@@ -273,7 +273,7 @@ export let uiView = [
273
273
  (isDefined(autoScrollExp) && !autoScrollExp) ||
274
274
  scope.$eval(autoScrollExp)
275
275
  ) {
276
- $uiViewScroll(clone);
276
+ $ngViewScroll(clone);
277
277
  }
278
278
  });
279
279
  cleanupLastView();
@@ -322,7 +322,7 @@ export function $ViewDirectiveFill(
322
322
  const initial = tElement.html();
323
323
  tElement.empty();
324
324
  return function (scope, $element) {
325
- const data = $element.data("$uiView");
325
+ const data = $element.data("$ngView");
326
326
  if (!data) {
327
327
  $element.html(initial);
328
328
  $compile($element[0].contentDocument || $element[0].childNodes)(
@@ -333,7 +333,7 @@ export function $ViewDirectiveFill(
333
333
  const cfg = data.$cfg || { viewDecl: {}, getTemplate: () => {} };
334
334
  const resolveCtx = cfg.path && new ResolveContext(cfg.path);
335
335
  $element.html(cfg.getTemplate($element, resolveCtx) || initial);
336
- trace.traceUIViewFill(data.$uiView, $element.html());
336
+ trace.traceUIViewFill(data.$ngView, $element.html());
337
337
  const link = $compile(
338
338
  $element[0].contentDocument || $element[0].childNodes,
339
339
  );