首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >将obj/array读取到html

将obj/array读取到html
EN

Stack Overflow用户
提问于 2018-07-27 07:06:22
回答 1查看 26关注 0票数 -2

快速问答..我试图让我的html读取我的对象/数组的name属性,但我失败了。我有html:

  <li ng-repeat="i in data">
        <h3>{{data.name}}</h3>
   </li>

我有lib,即:

data = [{"name":"a","code":"12"},{"name":"b","code":"331"},{"name":"c","code":"1231"}]

我的html li "ng-repeat="i in data“生成了正确数量的列表(3)。但是我的h3没有打印这些名称。我遗漏了什么?

EN

回答 1

Stack Overflow用户

发布于 2018-07-27 07:08:29

 <li ng-repeat="i in data">
        <h3>{{i.name}}</h3>
 </li>


... scope context
$scope.data = [{"name":"a","code":"12"},{"name":"b","code":"331"},{"name":"c","code":"1231"}]
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51548630

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档