如何使用AngularJS让这两段重复呢?

How to use AngularJS to make these two sections repeat?

我试图让 HTML 中的两个部分重复。第一部分应该重复两次,第二部分应该重复四次。

这是第二部分的具体内容(我希望重复四次)

这是我目前的进度 - Fiddle( wo Angular JS applied to the second) and Fiddle 2(w AngularJS)。 我让第一部分重复两次,但是当我将重复指令应用于第二部分时,第二部分消失了....

为了完成这两项任务,我使用 AngularJS Ng-Repeat directive. I made sure to only bootstrap or initialize the Angular app once in a outer div that contains both sections. I followed syntax from Objects 将数据分组到 JavaScript 中。我没有读到任何说你不能有超过一个 ng-init 的东西(我用两个来初始化两个部分的数据)

<div id="rest_contents" data-ng-app=""> .....

有没有人发现我的语法有问题或我哪里做错了?

检查您的控制台日志,您的部分列表定义存在语法错误。你有 pictorial= 但它应该是 pictorial:

<div data-ng-init="sections=[{title: 'Campaign', pictorial:'campaign.png'},
         {title: 'TV Ads', pictorial:'tv_adds.png'} , {title:'Video Archive',pictorial: 'video_archive.png'},
    {title: 'House Showcases', pictorial: 'house_showcases.png'}]" >