The cyclic output of the data source in AngularJS

The cyclic output of the data source in AngularJS

has recently been exposed to the Angular front end frame, but the feeling effect is more obvious, especially in the data output To look at it, it is much higher than the original JS programming efficiency, so this is why many companies have requested front-end development. You are familiar with the use of front-end frames, which can improve the efficiency of the project faster. Today I want to say is the cyclic output of the data source when using the Angular front end frame.

Putting the data cycle in the array to the page. If the method used by JS is to make the array for FOR loop output, and when the output is in the DOM layer in the page The node is operated, and if the front-end frame is used (Angular), the instructions of the data cycle output have been packaged, namely NG-repeat.

{{item.name}} {{$ INDEX}}
  
This is a loop output for data in array book. It is a unique NG to illustrate the NG- to describe the label, just in WeChat development. When the instructions are, there is WX-to mark the same effect as the description.
But if your interface involves switching of the TAB column, the interface may appear like the left is the data corresponding to the species of the species, that is, your data may be similar to


$ scope.book = [{idx: 7, name: “Military”, Value: [{Name: ‘US City Politics “Price: 37 }, {Name: ‘Art: 45}, {Name:’ Defense Theory ‘, Price: 14}, {Name:’ Overall War ‘, Price: 13}, {Name: ‘Naval Strategy’, Price: 11}]}, {IDX: 8, Name: “Emotion”, Value: [{Name: ‘Tromethical’, Price: 12}]}]


How to display the specific data corresponding to the military in the interface, or display the specific data corresponding to the emotions on the interface, in fact, the classification output data is performed according to the classification of the data
   
{{ip.name}} [{ip.price | currency: ‘¥’ }}


  The effect of such an output is based on the data. Classification to classify the data, that is, a two-layer nesting cycle, the data of the second layer loop is the result of the first cycle so that one class data can be output to the UL below the LI, Cyclic output in the specification of the category 
  • If you have any questions, please leave a message or to this site community communication discussion, thank you reading, I hope to help everyone, thank you for your support!
© Copyright Notice
THE END
Just support it if you like
like0
share
comment Grab the couch

Please log in to comment