我在控制器事件数组声明的事件,每文档UI日历不工作,不渲染
eventSources: [
{
events: [
{ title: 'event1', start: '2017-09-27' },
{ title: 'event2', start: '2017-09-27', end: '2017-09-27' },
{ title: 'event3', start: '2017-09-27T12:30:00', }
]
}
]
我加入NG-模型日历组件定义(VM为控制器的一个别名) 。
取而代之的是日历,填充了这些事件,我看到,不要告诉我什么错误消息的空白日历和吨。哪里不对?
有人要求把完整的代码,不知道这是怎么回事帮助,但在这里它是,calendar.component.ts:
namespace AppDomain {
class CalendarComponent {
public bindings: any;
public controller: any;
public controllerAs: string;
public templateUrl: string;
constructor() {
this.controller = CalendarController;
this.controllerAs = 'vm';
this.templateUrl = '/app/calendar/calendar.component.html';
}
}
class CalendarController {
eventSources: [
{
events: [
{ title: 'event1', start: '2017-09-27' },
{ title: 'event2', start: '2017-09-27', end: '2017-09-27' },
{ title: 'event3', start: '2017-09-27T12:30:00', }
]
}
]
constructor() { }
$onInit() { }
}
angular.module('app').component('calendarComponent', new CalendarComponent());
}
而且calendar.component.html:
<div ui-calendar ng-model="vm.eventSources"></div>
希望这有助于
UPDATE
即使我添加UI日历这样的,没有任何NG-模型事件,
<div ui-calendar></div>
只是一个空白日历,我仍然得到所有这些错误
UPDATE2
我TRIE d此过程中,以及:
events2: [
{ title: 'event1', start: '2017-09-27' },
{ title: 'event2', start: '2017-09-27', end: '2017-09-27' },
{ title: 'event3', start: '2017-09-27T12:30:00', }
]
然后
同样的问题
您可以添加更多的代码? – bazzells
你认为它会帮助你吗? – monstro
在这里,添加了代码! – monstro