angularjs recursive ng-include not refreshing when onload variable changes -
given example at:
the easiest way can explain interaction steps...
problem case:
- select item 1, see item1.items in box 2
- select item 2, see item1.items in box 2 still! (should item2.items in box 2)
functional case:
- select item 1, see item1.items in box 2
- select --root--, removes box 2
- select item 2, see item2.items in box 2
i think problem somewhere ng-include recursion...
<div ng-if="level < path.length && path[level] && citem.items[path[level]] && citem.items[path[level]].items" ng-include="'item_select_recur.html'" onload="citem=citem.items[path[level]];level=level+1;"></div>
solved it!
the magic in manually updating box 2's scope (see jsfiddle complete example):
nextelement.scope().citem = parentitem.items[$scope.path[level]];
Comments
Post a Comment