Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 一行angular代码可以在JSFIDLE中工作,但不能在plunkr中工作_Angularjs - Fatal编程技术网

Angularjs 一行angular代码可以在JSFIDLE中工作,但不能在plunkr中工作

Angularjs 一行angular代码可以在JSFIDLE中工作,但不能在plunkr中工作,angularjs,Angularjs,我试图将一些代码从JSFIDLE复制到plunkr。我在plunkr几乎可以使用它,除了最后一个ng,重复一个带有时隙的: <div ng-controller="taskViewCtrl"> <table style="width:auto;" class="table table-bordered"> <tbody ng-model="subtasks"> <tr ng-repeat="subtask

我试图将一些代码从JSFIDLE复制到plunkr。我在plunkr几乎可以使用它,除了最后一个ng,重复一个带有时隙的:

<div ng-controller="taskViewCtrl">
    <table style="width:auto;" class="table table-bordered">
        <tbody ng-model="subtasks">
            <tr ng-repeat="subtask in subtasks" class="item" style="cursor: move;">
                <td>{{$index}} Worker {{subtask.workerId}}</td>
                <td ng-repeat="timeslot in subtask.subtaskArray">{{timeslot}}</td>
            </tr>
        </tbody>
    </table>
</div>
jsfiddle:

普朗克:


他们使用了两个不同的角度版本1.02和1.2.7,但我确信问题并不存在。很可能我在某个地方犯了错误,但在哪里?

您确定问题不在不同的角度版本中吗?你有没有注意到中继器中不允许出现红色的大副本。。。控制台中的错误。在plunkr和JSFIDLE中,我在使用Chrome的控制台中都没有遇到这样的错误。。。关于版本,我将尝试更改版本,然后看看会发生什么…plunker中的版本也更改为与JSFIDLE中的版本相同,这也没有帮助…哦,对不起,Stewie,我在另一个版本上测试。关于这个错误,你的回答当然是正确的。还有这个版本!把它作为一个答案,我可以接受吗?但是,如何让它在Angular的新版本中正常工作?为了让它在Angular的新版本中正常工作,我必须按照以下示例:ng repeat start=subtask track by$index中的subtask,因为ng repeat需要所有数组元素都是唯一的。例如,我的案例[0,0,0,1,1,1,1]不允许这样做。这可以通过track by和$index解决。