0

I just found out, that when using the infinite structure in a directive on every model update, the template will get messed up on too many ng-changes. This is caused by the ng-include (I figured out). I use somekind of this in my directive's template via templateUrl, which is written in HAML:

.btn-group{ :name => "FIXME", "ng-required" => "true" }
  %a.btn.btn-default.dropdown-toggle{ "data-toggle" => "dropdown", href: "#", "ng-disabled"=>"ngDisabled" }
    {{currentValue.name || dropdownPlaceholder }}
    %span.caret
  %ul.dropdown-menu{ "ng-show" => "!ngDisabled" }
    %div{ "ng-repeat" => "model in ngModel", "ng-include" => "'node.html'" }

%script{ :type => "text/ng-template", :id => "node.html" }
  %li{ "ng-click" => "selectValue(model)" }
    %a
      {{model.name}}
  %ul{ "ng-repeat" => "model in model.children", :style => "margin-left: 10px;" }
    %div{ "ng-include" => "'node.html'" }

on many clicks on the dropdown the view seems to keeps the old items and seems to push the new ones additionally, even though the debug states the model is updating correctly and clean (checked also in directives model). I get an buggy output like this:

https://dl.dropboxusercontent.com/u/21600359/Bildschirmfoto%202013-10-13%20um%2001.31.30.png

Does anybody can give me a hint on how to have ng-include refresh and rebuild the directives template tree like structure?

I really appreciate!

kind regards, Alex

sp33c
  • 494
  • 1
  • 5
  • 15
  • possible duplicate of [AngularJS: directive's template is not rendering correctly](http://stackoverflow.com/questions/19338052/angularjs-directives-template-is-not-rendering-correctly) – jpmorin Oct 13 '13 at 01:11
  • You already asked help for this problem, please look at my answer overthere... – jpmorin Oct 13 '13 at 01:12

0 Answers0