直接上代码
<! docType html> <html> <head> <meta name = "description"content = "[ngrepeat in obj and arr]"> <script src = "https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.14/angular.min.js"> </script> </script> charset = "utf-8"> <title> js bin </title> </head> <body> <div ng-app = "myapp"> <div ng-controller = "testctrl"> {{test1}} <div> <label ""ng-Repeat = "item in list1"> {item.id}}- {{item. {{key}} - {{value.text}} - {{value.value}} </div> </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', 'kuma'}, {id : ',', ','value '}; $ scope.obj1 = { '1': 'seti', '2': 'kuma', '3': 'cent'}; { 'seti', 'seti', 's1'}, 'abc': {text : 'value :'s2 '},'텍스트 ', };});