2
<div class="row-fluid" ng-repeat="timeline in timeline_events">
    <div class="span3 span3-min"><p>{{timeline.link}}</p></div>
    <div class="span2 span2-min"><p>{{timeline.other}}</p></div>
    <div class="span2 span2-min"><p>{{timeline.description}}</p></div>
    <div class="span1 span1-min">
        <p>
            <a class='del-timeline' ng-click='delTimeline($index)'>X</a>
        </p>
    </div>
</div>

时间轴事件在 chrome 中完美呈现,但在 firefox 中没有。我已清除会话并检查。没有结果。可能是什么问题?

更新:所以我通过ajax request.Firefox 访问timeline_events,如果我通过ajax 获取值不呈现任何ng-repeat 指令。在chrome 和safari 中完美运行。任何补救措施?

4

1 回答 1

1

这是您的代码的 JS Fiddle,它也应该在 firefox 中工作:

<div ng-controller='mainCtrl' class="container">
<div class="row-fluid" ng-repeat="timeline in timeline_events">
    <div class="span3 span3-min">
        <p>{{timeline.link}}</p>
    </div>
    <div class="span2 span2-min">
        <p>{{timeline.other}}</p>
    </div>
    <div class="span2 span2-min">
        <p>{{timeline.description}}</p>
    </div>
    <div class="span1 span1-min">
        <p> <a class='del-timeline' ng-click='delTimeline($index)'>X</a>
        </p>
    </div>
</div>

angular.module('myApp', [])
    .controller("mainCtrl", function ($scope) {
    $scope.timeline_events = [{
        link: 'link 1',
        other: 'other 1',
        description: 'description 1'
    }, {
        link: 'link 2',
        other: 'other 2',
        description: 'description 2'
    }, {
        link: 'link 3',
        other: 'other 3',
        description: 'description 3'
    }];
    $scope.delTimeline = function (index) {
        $scope.timeline_events.splice(index, 1);
    };
});

http://jsfiddle.net/alfrescian/5hVmc/

于 2013-07-16T08:31:01.010 回答