Detailed explanation of AngularJS using ng-repeat to traverse two-dimensional array elements

小云云
Release: 2017-12-22 10:51:43
Original
2335 people have browsed it

When doing a report project, there is a situation where the backend returns a two-dimensional array to me, and the data is put into the table in the frontend. Because we are using the frontend framework of angularJS, we use ng-repeat. accomplish. This article mainly introduces the method of AngularJS using ng-repeat to traverse two-dimensional array elements, and analyzes the related operation skills of AngularJS two-dimensional array element traversal in the form of examples. Friends who need it can refer to it. I hope it can help everyone.

Implementation method:

First in js:

$scope.Week = [[ '云南省 ', 'a', 's', 'd', 'e', 'w','t' ],[ '陕西省 ', 'l', 'p', 'o', 'i', 'u','y' ],[ '青海省 ', 1, 2, 4, 4, 5, 6 ] ];
Copy after login

In HTML:

Style 1:

    • {{b}}
Copy after login

Style 2:

{{b}}
Copy after login

The test sample code is as follows:

    www.jb51.net 遍历二维数组元素   
遍历数组所有元素(样式一):
    • {{b}}
遍历数组所有元素(样式二):
{{b}}
Copy after login

Running effect:

Related recommendations;

Traversing two-dimensional arrays with different forms of output in PHP Methods

Array PHP code for traversing two-dimensional arrays

Discuss traversal in PHP Detailed explanation of several methods of two-dimensional array_PHP tutorial

The above is the detailed content of Detailed explanation of AngularJS using ng-repeat to traverse two-dimensional array elements. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!