如何设置键值配对ng-repeat的限制

时间:2016-08-18 07:31:21

标签: javascript angularjs json angularjs-ng-repeat

//i have a json object as 
var jsonObject= {
        "sekhar88Question": [{
            "ID": "3330",
            "post_content": "Anssssssssss"
        }, {
            "ID": "3331",
            "post_content": "Answwwwwwwwwwww"
        }],
        "qqqqyyyyyyyyyy": null,
        "harishQuestion": null,
        "harishQuestion2": null
    }
}

//使用ng-repeat

显示值
  <div ng-repeat="(key, data) in jsonObject">
     Q. {{key}}
    <div ng-repeat="answers in data">
       A. {{answers.post_content}}
     </div>
   </div>

// json对象有4个键值对。我想在视图中仅显示2个键值对数据。 ie ..限制json数据。

0 个答案:

没有答案