【发布时间】:2014-02-28 00:01:09
【问题描述】:
我有一个我正在尝试使用 Json 构建的简历结构。简历部分如下:
Cisco
- Software Engineer
- Try different technologies to make user friendly applications
- Playing with javascript and Json to create a personal website
我有一个 JSON 结构如下:
{
"sections":
[
{
"company": "Cisco",
"title":"Software Engineer",
"desc":
[
{
"line1": "Try different technologies to make user friendly applications",
"line2": "Playing with javascript and Json to create a personal website"
}
]
}
]
}
我正在使用 index.html 中的以下脚本来获取 json 数据:
<div ng:switch-when="job" itemscope itemprop="organization" itemtype="http://schema.org/Organization">
<section class="job {{isLast(section.data.length,$index)}}" ng:repeat="job in section.data">
<h2>{{job.company|microdata:"name"}}{{job.url|external}}</h2>
<h3>{{job.title}}</h3>
<h2>{{job.desc.line1}}</h2>
<h2>{{job.desc.line2}}</h2>
</section>
</div>
我没有得到 line1 & line2 的预期输出。是我做错了什么还是渗透到了键值对中的第 1 级?
我是一个完整的 json 和 javascript 新手,所以请指导。谢谢。
【问题讨论】:
标签: javascript jquery html json angularjs