2016-11-14 19 views
1

我有以下对象。需要在对象上使用ng-repeat

$scope.sampleObj = 
    { 
    "id": 10000, 
    "transactionid": "gec43434", 
    "status": "COMPLETED", 
    "session_id": "TTYUU455667" 
    } 

现在我需要使用ng-repeat在标签和文本区域中显示此对象键。基本上我想在对象属性上使用ng-repeat,这有可能吗?

我不得不使用类似:

<div ng-repeat="eachProp in sampleObj"> 
<label> {{eachProp.key}} </label> <textarea ng-model="eachProp.value"> </textarea> 
</div> 

回答