1
- /**
2
- * @ng 1api
3
- * @module directives
4
- */ /** for typedoc */
5
- import { ng as angular } from '../angular' ;
6
- import { IInterpolateService , IScope , ITranscludeFunction , IAugmentedJQuery , ITimeoutService } from 'angular' ;
7
-
8
1
import {
2
+ $QLike ,
3
+ ActiveUIView ,
9
4
extend ,
10
- unnestR ,
11
5
filter ,
12
- tail ,
6
+ HookRegOptions ,
13
7
isDefined ,
14
8
isFunction ,
15
9
isString ,
16
- trace ,
10
+ kebobString ,
11
+ noop ,
12
+ Obj ,
13
+ Param ,
17
14
parse ,
18
- ActiveUIView ,
19
- TransitionService ,
20
- ResolveContext ,
21
- Transition ,
22
15
PathNode ,
16
+ ResolveContext ,
23
17
StateDeclaration ,
24
- Param ,
25
- kebobString ,
26
- HookRegOptions ,
27
- ViewService ,
28
- $QLike ,
29
- Obj ,
18
+ tail ,
19
+ trace ,
20
+ Transition ,
21
+ TransitionService ,
30
22
TypedMap ,
31
- noop ,
23
+ unnestR ,
24
+ ViewService ,
32
25
} from '@uirouter/core' ;
33
- import { Ng1ViewConfig } from '../statebuilders/views' ;
26
+ import { IAugmentedJQuery , IInterpolateService , IScope , ITimeoutService , ITranscludeFunction } from 'angular' ;
27
+ /**
28
+ * @ng 1api
29
+ * @module directives
30
+ */
31
+ /** for typedoc */
32
+ import { ng as angular } from '../angular' ;
34
33
import { Ng1Controller , Ng1StateDeclaration } from '../interface' ;
35
34
import { getLocals } from '../services' ;
35
+ import { Ng1ViewConfig } from '../statebuilders/views' ;
36
36
import { ng1_directive } from './stateDirectives' ;
37
37
38
38
/** @hidden */
@@ -368,6 +368,7 @@ uiView = [
368
368
] ;
369
369
370
370
$ViewDirectiveFill . $inject = [ '$compile' , '$controller' , '$transitions' , '$view' , '$q' , '$timeout' ] ;
371
+
371
372
/** @hidden */
372
373
function $ViewDirectiveFill (
373
374
$compile : angular . ICompileService ,
@@ -477,7 +478,7 @@ function registerControllerCallbacks(
477
478
const viewState : Ng1StateDeclaration = tail ( cfg . path ) . state . self ;
478
479
479
480
const hookOptions : HookRegOptions = { bind : controllerInstance } ;
480
- // Add component-level hook for onParamsChange
481
+ // Add component-level hook for onUiParamsChanged
481
482
if ( isFunction ( controllerInstance . uiOnParamsChanged ) ) {
482
483
const resolveContext : ResolveContext = new ResolveContext ( cfg . path ) ;
483
484
const viewCreationTrans = resolveContext . getResolvable ( '$transition$' ) . data ;
@@ -491,13 +492,14 @@ function registerControllerCallbacks(
491
492
492
493
const toParams = $transition$ . params ( 'to' ) as TypedMap < any > ;
493
494
const fromParams = $transition$ . params < TypedMap < any > > ( 'from' ) as TypedMap < any > ;
495
+ const getNodeSchema = ( node : PathNode ) => node . paramSchema ;
494
496
const toSchema : Param [ ] = $transition$
495
- . treeChanges ( )
496
- . to . map ( ( node : PathNode ) => node . paramSchema )
497
+ . treeChanges ( 'to' )
498
+ . map ( getNodeSchema )
497
499
. reduce ( unnestR , [ ] ) ;
498
500
const fromSchema : Param [ ] = $transition$
499
- . treeChanges ( )
500
- . from . map ( ( node : PathNode ) => node . paramSchema )
501
+ . treeChanges ( 'from' )
502
+ . map ( getNodeSchema )
501
503
. reduce ( unnestR , [ ] ) ;
502
504
503
505
// Find the to params that have different values than the from params
0 commit comments