Friday, 15 April 2011

javascript - can't show ng-template in ng-repeat -


I have a ng-repeat to the ng-template Also does not show items. How is this possible?

  & lt; Script type = "text / ng-template" id = "tree_renderer" & gt; & Lt; Period & gt; {{E. Names}} & lt; / Span & gt; & Lt; / Script & gt; & Lt; Div class = "tree" & gt; & Lt; Ul & gt; & Lt; Li ng-repeat = "n in item" ng-include = "'tree_render'" & gt; & Lt; / Li & gt; & Lt; Li ng-repeat = "item in e" & gt; {{E. Names}} & lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Div & gt;  


  'strict experiment'; Angular.module ('nodeTreeApp'). Controller ('NodeCtrl', function ($ radius, $ dialog, $ http) {$ scope.items = [{"name": "root", "type_name": "node", "show": true, "nodes True, "nodes": [{"Name": "Node-1" node-1-1 ":" Node-1 "," Show " , "Show": true, "nodes": []}, {"name": "node-1-2", "device_name": "node-1-2", "show": true, "nodes" : []}, {"Name": "node-1-3", "device_name": "node-1-3", "show": true, "nodes": []}], {"name ":" God "," group_name ":" node-2 "," show ": true e," nodes ": [" name ":" fan "," device_name ":" node-2-1 "," show ": True," nodes ": []}]}, {" name ":" "node-3", "sh True: "nodes": []}, {"name": "Fess", "group_name": "node-4", "show": true, "nodes": []}]}];} );  


  'strict experiment'; Angle (module) '});});  

You should use .html in your template id and ng-included .

I created this example based on the code (s) you provided:

UPDATE

Hair nodes To display, you need to nested ng-repeat, but take a look.


No comments:

Post a Comment