直接上代码
<! Doctype html> <html> <head> <meta name = "description" content = "[ngrepeat in obj and arr]"> <script src = "https://cdnjs.cloudflare.min.min>" MetA/METACULAR.JS/1.3.14/angular.min.min.js "" "" "" <title> js bin </itement> </head> <body> <v ng-app = "myapp"> <div ng-controller = "testctrl"> {{test1}} <div> <label for = "" ng-repeat = "item di list1"> {{{{~ {{} {{{{{{{{{{> {{{{{{{{> {{{{{{{{{{{> {{{{{{{{{{> {{{ia. untuk = "" ng-repeat = "(key, value) di obj1"> {{key}}-{{value}} </label> <p> </p> 对于 obj 遍历的话 会根据 key 的首字母排序 <label for = "" ng-repeat = "(value, value) di obj2"> {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{ng-REPEAT = {{value.value}} </label> </div> </div> </div> </body> </html>JS
var app = angular.module ('myapp', []); app.controller ('testctrl', function ($ scope) {$ scope.test1 = 'tt'; $ scope.list1 = [{id: '1', value: 'seti'}, {id: '2', value: '{' 1 ', value:' seti '}, {id:' 2 ', value:' Kuma; $ scope.obj1 = {'1': 'seti', '2': 'kuma', '3': 'cent'}; };});