Angular UI-Calendar TypeError:calendar.fullCalendar 不是函数 [英] Angular UI-Calendar TypeError: calendar.fullCalendar is not a function
问题描述
我一直在尝试将 Angular: ui-calendar 与meteor 一起使用,但出现此错误.
I been trying to use Angular: ui-calendar with meteor, but get this error.
TypeError: calendar.fullCalendar is not a function
at Scope.scope.initCalendar (calendar.js:265)
at Object.fn (calendar.js:337)
at Scope.$digest (angular.js:15896)
at Scope.$apply (angular.js:16160)
at bootstrapApply (angular.js:1679)
at Object.invoke (angular.js:4523)
at doBootstrap (angular.js:1677)
at Object.bootstrap (angular.js:1697)
at HTMLDocument.onReady (app.js:47)
at fire (jquery.js:3143)
在流星包中我有:
角度 1.2.3angularui:ui-日历
angular 1.2.3 angularui:ui-calendar
也试过用包直接插入而不是用meteor add.但使用 calendar.js 文件(不同)
also tried to use the package inserted directly not using meteor add. but using the calendar.js file (which is different)
两者都得到相同的错误.
Both get the same error.
试过这个:https://github.com/angular-ui/ui-日历/问题/267
scope.initCalendar = function () {
if (!calendar) {
calendar = $(elm);
}
calendar.fullCalendar(options);
if (attrs.calendar) {
uiCalendarConfig.calendars[attrs.calendar] = calendar;
}
};
但似乎此修复程序不适用于meteor 和angular-meteor.
But is seems this fix doesnt work with meteor and angular-meteor.
有关如何解决此问题的任何想法?
Any ideas on how to fix this issue?
推荐答案
你应该检查 angular-ui-calendar/src 中的
.如果他们使用以下方法创建元素:initCalendar
和 destroyCalendar
方法/calendar.js
You should check the initCalendar
and destroyCalendar
methods in angular-ui-calendar/src/calendar.js
. If they're creating the element by using:
angular.element(elm).html('');
那么你应该把它替换成:
Then you should replace it by:
$(elm).html('');
这篇关于Angular UI-Calendar TypeError:calendar.fullCalendar 不是函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!