File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change 20
20
restrict : 'AEC' ,
21
21
require : req ,
22
22
scope : true ,
23
- compile : function ( elm ) {
24
- var link = {
23
+ compile : function ( elm , attr ) {
24
+ var watchExp = attr [ name ] || ( isRoot ? attr . root : attr . node ) ,
25
+ template ,
26
+ link = {
25
27
post : function ( scope , elm , attr , ctrl ) {
26
28
scope . $dxLevel = isRoot ? 0 : scope . $dxLevel + 1 ;
27
29
scope . $dxIsRoot = isRoot ;
28
- scope . $dxPrior = scope . $dxParent = isRoot
29
- ? parse ( attr [ name ] || attr . root ) ( scope )
30
- : parse ( attr [ name ] || attr . node ) ( scope ) ;
31
30
32
31
elm . html ( ctrl . template ( ) ) ;
33
32
compile ( elm . contents ( ) ) ( scope ) ;
33
+
34
+ function updatePrior ( value ) {
35
+ scope . $dxPrior = value ;
36
+ }
37
+ scope . $watch ( watchExp , updatePrior ) ;
34
38
}
35
39
} ;
36
40
if ( isRoot ) {
37
- var template = elm . html ( ) ;
41
+ template = elm . html ( ) ;
38
42
elm . html ( '' ) ;
39
43
link . pre = function ( scope , elm , attr , ctrl ) {
40
44
ctrl . template ( template ) ;
57
61
58
62
comp . directive ( 'dxStartWith' , $NodeDirective ( true , 'dxStartWith' , 'dxStartWith' ) ) ;
59
63
comp . directive ( 'dxConnect' , $NodeDirective ( false , 'dxConnect' , '^dxStartWith' ) ) ;
60
- } ( ) ) ;
64
+ } ( ) ) ;
You can’t perform that action at this time.
0 commit comments