1
-
2
1
module = angular .module ' angularBootstrapNavTree' ,[]
3
2
4
3
module .directive ' abnTree' ,[' $timeout' ,($timeout )->
@@ -144,23 +143,7 @@ module.directive 'abnTree',['$timeout',($timeout)->
144
143
on_treeData_change = ->
145
144
146
145
# console.log 'tree-data-change!'
147
-
148
- # give each Branch a UID ( to keep AngularJS happy )
149
- for_each_branch (b ,level )->
150
- if not b .uid
151
- b .uid = " " + Math .random ()
152
- console .log ' UIDs are set.'
153
-
154
-
155
- # set all parents:
156
- for_each_branch (b )->
157
- if angular .isArray b .children
158
- for child in b .children
159
- child .parent_uid = b .uid
160
-
161
-
162
- scope .tree_rows = []
163
-
146
+
164
147
#
165
148
# if "children" is just a list of strings...
166
149
# ...change them into objects:
@@ -180,6 +163,23 @@ module.directive 'abnTree',['$timeout',($timeout)->
180
163
else
181
164
branch .children = []
182
165
166
+
167
+ # give each Branch a UID ( to keep AngularJS happy )
168
+ for_each_branch (b ,level )->
169
+ if not b .uid
170
+ b .uid = " " + Math .random ()
171
+ console .log ' UIDs are set.'
172
+
173
+
174
+ # set all parents:
175
+ for_each_branch (b )->
176
+ if angular .isArray b .children
177
+ for child in b .children
178
+ child .parent_uid = b .uid
179
+
180
+
181
+ scope .tree_rows = []
182
+
183
183
184
184
#
185
185
# add_branch_to_list: recursively add one branch
0 commit comments