直接上代码
<! Doctype html> <html> <head> <meta name = "descripción" content = "[ngrepeat en obj and arr]"> <script src = "https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.14/angular.min.js"> </script> <set> <seta Charset " <title> js bin </title> </head> <body> <div ng-app = "myApp"> <div ng-controller = "testctrl"> {{test1}} <div> <etiqueta for = "" ng-epeat = "item in list1"> {{item.id}}-{item.value}} </etiqueta for = "" ng-repeat = "(clave, valor) en obj1"> {{key}}-{{value}} </labe {{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', valor: 'seti'}, {id: '2', valor: 'kuma'}, {id: '3', valor: valor: '}; $ scope.obj1 = {'1': 'seti', '2': 'kuma', '3': 'cent'}; $ scope.obj2 = {'ins': {text: 'seti', valor: 's1'}, 'ABC': {text: 'kuma', valor: 's2'}, 'coln': {text: 'oal };});