angular-ui-calendar undefined不是对象

时间:2015-11-16 18:39:28

标签: javascript angularjs html5 angular-ui

我使用fullcalendar的angular-ui-calendar有问题。 我不知道为什么它让我未定义不是一个对象:

错误:undefined不是对象(评估'array.length')

错误:undefined不是对象(评估'sources.length')

在控制器中,是的,我在控制器定义中有uiCalendarConfig

$scope.list = WorkingTime.query(function(){
            var result = [];
            for(var i = 0; i <$scope.list.length; i++){
                var helper = $scope.list[i];
                var helperFrom = new Date(new Date(helper.date).getFullYear(), new Date(helper.date).getMonth(), new Date(helper.date).getDate(), new Date(helper.from).getHours(), new Date(helper.from).getMinutes());
                var helperTo = new Date(new Date(helper.date).getFullYear(), new Date(helper.date).getMonth(), new Date(helper.date).getDate(), new Date(helper.to).getHours(), new Date(helper.to).getMinutes());
                var show = {title: helper.positions[0].name , start: helperFrom, end: helperTo};
                result.push(show);
            }
            $scope.source = [result];
        });

HTML

    <div ui-calendar="uiConfig.calendar" ng-model="source"></div>

请帮助我,没有更多的想法。 :(

修改

第一次出现的节目输出:

{title: "Boss", start: Tue Nov 17 2015 11:00:00 GMT+0100 (CET), end: Tue Nov 17 2015 13:00:00 GMT+0100 (CET)}

所以这是正确的。但仍然有错误

0 个答案:

没有答案