|
21 | 21 | var exp = attr['dxStartWith'] || attr.root,
|
22 | 22 | match = exp.match(SW_REGEX),
|
23 | 23 | watch = match[1],
|
24 |
| - priorAlias = match[3] || ''; |
| 24 | + alias = match[3] || ''; |
25 | 25 |
|
26 | 26 | return function $RootNodeDirectiveLink(scope, elm, attr, ctrl, $transclude) {
|
| 27 | + ctrl.alias = alias; |
27 | 28 | ctrl.transclude = $transclude;
|
28 | 29 | ctrl.transclude(scope, function (clone, scope) {
|
29 | 30 | elm.append(clone);
|
30 | 31 | scope.$dxLevel = 0;
|
31 | 32 | scope.$dxIsRoot = true;
|
32 | 33 | function updatePrior(value) {
|
33 | 34 | scope.$dxPrior = value;
|
34 |
| - if (priorAlias !== '') { |
35 |
| - scope[priorAlias] = value; |
| 35 | + if (alias !== '') { |
| 36 | + scope[alias] = value; |
36 | 37 | }
|
37 | 38 | }
|
38 | 39 | scope.$watch(watch, updatePrior);
|
|
52 | 53 | multiElement: true,
|
53 | 54 |
|
54 | 55 | compile: function (elm, attr) {
|
55 |
| - var exp = attr['dxConnect'] || attr.connect, |
56 |
| - match = exp.match(SW_REGEX), |
57 |
| - watch = match[1], |
58 |
| - priorAlias = match[3] || ''; |
| 56 | + var watch = attr['dxConnect'] || attr.connect; |
59 | 57 |
|
60 | 58 | return function $NodeDirectiveLink(scope, elm, attr, ctrl) {
|
| 59 | + alias = ctrl.alias || ''; |
61 | 60 | ctrl.transclude(scope, function (clone, scope) {
|
62 | 61 | elm.append(clone);
|
63 | 62 |
|
64 | 63 | scope.$dxLevel = scope.$dxLevel + 1;
|
65 | 64 | scope.$dxIsRoot = false;
|
66 | 65 | function updatePrior(value) {
|
67 | 66 | scope.$dxPrior = value;
|
68 |
| - if (priorAlias !== '') { |
69 |
| - scope[priorAlias] = value; |
| 67 | + if (alias !== '') { |
| 68 | + scope[alias] = value; |
70 | 69 | }
|
71 | 70 | }
|
72 | 71 |
|
|
0 commit comments