Javascript ng repeat无法读取属性';插入前';数据重新加载3次后的空值
我正在使用Slick Slider()在我的网页底部显示一个水平滑块:Javascript ng repeat无法读取属性';插入前';数据重新加载3次后的空值,javascript,html,angularjs,angularjs-ng-repeat,Javascript,Html,Angularjs,Angularjs Ng Repeat,我正在使用Slick Slider()在我的网页底部显示一个水平滑块: <div class="container" ng-if="loop"> <div class="row"> <slick dots="true" init-onload="true" data="schedule" center-mode="false" infinite="false" speed="300" slides-to-show="4" touch-move="true
<div class="container" ng-if="loop">
<div class="row">
<slick dots="true" init-onload="true" data="schedule" center-mode="false" infinite="false" speed="300" slides-to-show="4" touch-move="true" slides-to-scroll="1" class="slider one-time">
<div ng-repeat="x in schedule">
<div class="status-x-current">
<a class="x-button" ng-if="x.title == ''" data-ng-click="showRes(workplace, x)">Click here to to do something</a>
<h3 ng-if="x.title != ''" id = "x_title1" class="x-slider-title">Titel: {{x.title}}</h3>
<h3 ng-if="x.title != ''" id = "x_time1" class="x-slider-time">{{x.date}}</h3>
</div>
</div>
</slick>
</div>
这在重新加载前2次计划时效果很好,但在第三次之后,它会给我以下错误:
TypeError: Cannot read property 'insertBefore' of null
at angular.js?body=1:3851
at forEach (angular.js?body=1:304)
at Object.$AnimateProvider.$get.enter (angular.js?body=1:3850)
at angular.js?body=1:18726
at publicLinkFn (angular.js?body=1:5421)
at ngRepeatAction (angular.js?body=1:18724)
at Object.$watchCollectionAction [as fn] (angular.js?body=1:11300)
at Scope.$get.Scope.$digest (angular.js?body=1:11396)
at Scope.$get.Scope.$apply (angular.js?body=1:11635)
at done (angular.js?body=1:7636)(anonymous function) @ angular.js?body=1:9038$get @ angular.js?body=1:6649$get.Scope.$digest @ angular.js?body=1:11408$get.Scope.$apply @ angular.js?body=1:11635done @ angular.js?body=1:7636completeRequest @ angular.js?body=1:7802xhr.onreadystatechange @ angular.js?body=1:7758
我100%确定每次重新加载时,日程安排都完全相同。我想这是因为
initonload=“true”data=“schedule”
。从html中删除该行后,不会发生此错误。但移除这条线会导致slick行为不正确。当删除init onload=“true”data=“schedule”
时,Slick将把所有幻灯片塞进屏幕,而不是只显示4张幻灯片(幻灯片到show=“4”)?我有一个类似的问题,只有在第二次数据加载之后才会发生。不,我只是决定不使用slick slider。
TypeError: Cannot read property 'insertBefore' of null
at angular.js?body=1:3851
at forEach (angular.js?body=1:304)
at Object.$AnimateProvider.$get.enter (angular.js?body=1:3850)
at angular.js?body=1:18726
at publicLinkFn (angular.js?body=1:5421)
at ngRepeatAction (angular.js?body=1:18724)
at Object.$watchCollectionAction [as fn] (angular.js?body=1:11300)
at Scope.$get.Scope.$digest (angular.js?body=1:11396)
at Scope.$get.Scope.$apply (angular.js?body=1:11635)
at done (angular.js?body=1:7636)(anonymous function) @ angular.js?body=1:9038$get @ angular.js?body=1:6649$get.Scope.$digest @ angular.js?body=1:11408$get.Scope.$apply @ angular.js?body=1:11635done @ angular.js?body=1:7636completeRequest @ angular.js?body=1:7802xhr.onreadystatechange @ angular.js?body=1:7758