Skip to content
This repository was archived by the owner on May 26, 2023. It is now read-only.

Commit 40b4b23

Browse files
chore(uiView): fix comment
1 parent f8bc1af commit 40b4b23

File tree

1 file changed

+29
-27
lines changed

1 file changed

+29
-27
lines changed

src/directives/viewDirective.ts

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
/**
2-
* @ng1api
3-
* @module directives
4-
*/ /** for typedoc */
5-
import { ng as angular } from '../angular';
6-
import { IInterpolateService, IScope, ITranscludeFunction, IAugmentedJQuery, ITimeoutService } from 'angular';
7-
81
import {
2+
$QLike,
3+
ActiveUIView,
94
extend,
10-
unnestR,
115
filter,
12-
tail,
6+
HookRegOptions,
137
isDefined,
148
isFunction,
159
isString,
16-
trace,
10+
kebobString,
11+
noop,
12+
Obj,
13+
Param,
1714
parse,
18-
ActiveUIView,
19-
TransitionService,
20-
ResolveContext,
21-
Transition,
2215
PathNode,
16+
ResolveContext,
2317
StateDeclaration,
24-
Param,
25-
kebobString,
26-
HookRegOptions,
27-
ViewService,
28-
$QLike,
29-
Obj,
18+
tail,
19+
trace,
20+
Transition,
21+
TransitionService,
3022
TypedMap,
31-
noop,
23+
unnestR,
24+
ViewService,
3225
} from '@uirouter/core';
33-
import { Ng1ViewConfig } from '../statebuilders/views';
26+
import { IAugmentedJQuery, IInterpolateService, IScope, ITimeoutService, ITranscludeFunction } from 'angular';
27+
/**
28+
* @ng1api
29+
* @module directives
30+
*/
31+
/** for typedoc */
32+
import { ng as angular } from '../angular';
3433
import { Ng1Controller, Ng1StateDeclaration } from '../interface';
3534
import { getLocals } from '../services';
35+
import { Ng1ViewConfig } from '../statebuilders/views';
3636
import { ng1_directive } from './stateDirectives';
3737

3838
/** @hidden */
@@ -368,6 +368,7 @@ uiView = [
368368
];
369369

370370
$ViewDirectiveFill.$inject = ['$compile', '$controller', '$transitions', '$view', '$q', '$timeout'];
371+
371372
/** @hidden */
372373
function $ViewDirectiveFill(
373374
$compile: angular.ICompileService,
@@ -477,7 +478,7 @@ function registerControllerCallbacks(
477478
const viewState: Ng1StateDeclaration = tail(cfg.path).state.self;
478479

479480
const hookOptions: HookRegOptions = { bind: controllerInstance };
480-
// Add component-level hook for onParamsChange
481+
// Add component-level hook for onUiParamsChanged
481482
if (isFunction(controllerInstance.uiOnParamsChanged)) {
482483
const resolveContext: ResolveContext = new ResolveContext(cfg.path);
483484
const viewCreationTrans = resolveContext.getResolvable('$transition$').data;
@@ -491,13 +492,14 @@ function registerControllerCallbacks(
491492

492493
const toParams = $transition$.params('to') as TypedMap<any>;
493494
const fromParams = $transition$.params<TypedMap<any>>('from') as TypedMap<any>;
495+
const getNodeSchema = (node: PathNode) => node.paramSchema;
494496
const toSchema: Param[] = $transition$
495-
.treeChanges()
496-
.to.map((node: PathNode) => node.paramSchema)
497+
.treeChanges('to')
498+
.map(getNodeSchema)
497499
.reduce(unnestR, []);
498500
const fromSchema: Param[] = $transition$
499-
.treeChanges()
500-
.from.map((node: PathNode) => node.paramSchema)
501+
.treeChanges('from')
502+
.map(getNodeSchema)
501503
.reduce(unnestR, []);
502504

503505
// Find the to params that have different values than the from params

0 commit comments

Comments
 (0)