Home > front end >  Angularjs dynamically add elements
Angularjs dynamically add elements

Time:10-05

 
& lt; Div>
& lt; Ul>
& lt; Li ng - repeat="s in list1" & gt;
& lt; A href="" & gt; {{s.n ame}} & lt;/a>
& lt; Ul>
& lt; Li ng - repeat="ch in list2 ng - click"="add (ch. Id)" & gt;
{{ch. Name}}
//the current click li created under ul li
& lt;/li>
& lt;/ul>
& lt;/li>
& lt;/ul>
& lt;/div>


How the add () reads the data returned json, according to the json data generating a layer of ul li, generated a tree structure

CodePudding user response:

Circulation,,,,,,,,,,,,,,,,,,,,,

CodePudding user response:

JKBJKBKBK

CodePudding user response:

Circulation,,,,,,,,,,,,,,,,,,,,,
  • Related