Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/20.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
Javascript 带require错误的角度ui日历_Javascript_Angularjs_Calendar - Fatal编程技术网

Javascript 带require错误的角度ui日历

Javascript 带require错误的角度ui日历,javascript,angularjs,calendar,Javascript,Angularjs,Calendar,我试图在我的angularjs页面中使用AngularUI日历,并要求使用库。 我将AngularUI日历放在bower.json中,然后安装它。 现在在我的主要模块上,我写了以下内容(Thera有更多的库,但我在示例中推荐了它: (function (require) { "use strict"; require.config({ paths: { 'angular': '../../../bower_components/angula

我试图在我的angularjs页面中使用AngularUI日历,并要求使用库。 我将AngularUI日历放在bower.json中,然后安装它。 现在在我的主要模块上,我写了以下内容(Thera有更多的库,但我在示例中推荐了它:

(function (require) {
    "use strict";
    require.config({
        paths: {
            'angular': '../../../bower_components/angular/angular',
            'angular-ui-calendar': '../../../bower_components/angular-ui-calendar/src/calendar'

        },
        shim: {
            'angular': { deps: [], exports: 'angular' },
            'angular-ui-calendar': {deps: ['angular', 'bootstrap']}
        }
    });

    require([
        "angular", "angular-route", "angular-resource", "angular-sanitize", "angular-moment",
        "jquery", "bootstrap", "app",
        "moment", "moment-es", "abn_tree_directive", "underscore", "ui-utils", "jspdf", "angular-ui-calendar"
    ], function (angular) {
        angular.bootstrap(document, ["app"]);
    });
}(require));
现在,在我的angularjs控制器中

var bill = angular.module("bill", ["ngRoute", "ngResource", "directives",'ui.calendar']);
在网上,我发现了这个错误:

TypeError: Cannot read property 'length' of undefined
    at Object.changeWatcher.getTokens (http://localhost:8000/bower_components/angular-ui-calendar/src/calendar.js:86:36)
    at Scope.$get.Scope.$digest (http://localhost:8000/bower_components/angular/angular.js:12243:40)
    at Scope.$get.Scope.$apply (http://localhost:8000/bower_components/angular/angular.js:12516:24)
    at done (http://localhost:8000/bower_components/angular/angular.js:8204:45)
    at completeRequest (http://localhost:8000/bower_components/angular/angular.js:8412:7)
    at XMLHttpRequest.xhr.onreadystatechange (http://localhost:8000/bower_components/angular/angular.js:8351:11) angular.js:9778
TypeError: Cannot read property 'length' of undefined
    at allEvents (http://localhost:8000/bower_components/angular-ui-calendar/src/calendar.js:54:41)
    at Object.changeWatcher.getTokens (http://localhost:8000/bower_components/angular-ui-calendar/src/calendar.js:84:57)
    at Scope.$get.Scope.$digest (http://localhost:8000/bower_components/angular/angular.js:12243:40)
    at Scope.$get.Scope.$apply (http://localhost:8000/bower_components/angular/angular.js:12516:24)
    at done (http://localhost:8000/bower_components/angular/angular.js:8204:45)
    at completeRequest (http://localhost:8000/bower_components/angular/angular.js:8412:7)
    at XMLHttpRequest.xhr.onreadystatechange (http://localhost:8000/bower_components/angular/angular.js:8351:11) angular.js:9778
TypeError: undefined is not a function
    at Scope.link.scope.init (http://localhost:8000/bower_components/angular-ui-calendar/src/calendar.js:226:26)
    at Object.fn (http://localhost:8000/bower_components/angular-ui-calendar/src/calendar.js:262:19)
    at Scope.$get.Scope.$digest (http://localhost:8000/bower_components/angular/angular.js:12251:29)
    at Scope.$get.Scope.$apply (http://localhost:8000/bower_components/angular/angular.js:12516:24)
    at done (http://localhost:8000/bower_components/angular/angular.js:8204:45)
    at completeRequest (http://localhost:8000/bower_components/angular/angular.js:8412:7)
    at XMLHttpRequest.xhr.onreadystatechange (http://localhost:8000/bower_components/angular/angular.js:8351:11) angular.js:9778
TypeError: Cannot read property 'length' of undefined
    at Object.changeWatcher.getTokens (http://localhost:8000/bower_components/angular-ui-calendar/src/calendar.js:86:36)
    at Scope.$get.Scope.$digest (http://localhost:8000/bower_components/angular/angular.js:12243:40)
    at Scope.$get.Scope.$apply (http://localhost:8000/bower_components/angular/angular.js:12516:24)
    at done (http://localhost:8000/bower_components/angular/angular.js:8204:45)
    at completeRequest (http://localhost:8000/bower_components/angular/angular.js:8412:7)
    at XMLHttpRequest.xhr.onreadystatechange (http://localhost:8000/bower_components/angular/angular.js:8351:11) angular.js:9778
TypeError: Cannot read property 'length' of undefined
    at allEvents (http://localhost:8000/bower_components/angular-ui-calendar/src/calendar.js:54:41)
    at Object.changeWatcher.getTokens (http://localhost:8000/bower_components/angular-ui-calendar/src/calendar.js:84:57)
    at Scope.$get.Scope.$digest (http://localhost:8000/bower_components/angular/angular.js:12243:40)
    at Scope.$get.Scope.$apply (http://localhost:8000/bower_components/angular/angular.js:12516:24)
    at done (http://localhost:8000/bower_components/angular/angular.js:8204:45)
    at completeRequest (http://localhost:8000/bower_components/angular/angular.js:8412:7)
    at XMLHttpRequest.xhr.onreadystatechange (http://localhost:8000/bower_components/angular/angular.js:8351:11) 

日历不显示..需要我将依赖项放在main.js中以加载require o do it本身吗?有人知道有什么问题吗?

我面临同样的问题“无法读取allEvents处未定义的属性“length”。你能指导我如何解决这个问题吗?