角度2完整日历:如何设置资源[事件]

时间:2018-02-19 17:29:08

标签: javascript jquery angular fullcalendar angular2-template

我正面临着事件的问题 - >完整日历中的资源我已经尝试了很多。
我按照这个链接git full calendar完成了。所有的好我在这里完全得到了视图我试图获得资源列表在顶部但得到错误
component.ts

import { IMyDpOptions, IMyDateModel } from 'mydatepicker';
import * as $ from 'jquery';
import { FullCalendarModule } from 'ng-fullcalendar';
import { CalendarComponent } from 'ng-fullcalendar';
import { Options } from 'fullcalendar';


export class ClientCalendarComponent implements OnInit {
    calendarOptions: Options;
    @ViewChild(CalendarComponent) ucCalendar: CalendarComponent;
    constructor(private clientCalendarService: ClientCalendarService,
        private route: ActivatedRoute,
        private router: Router) {
    }

    ngOnInit() {
        this.calendarOptions = {
            editable: true,
            eventLimit: false,
            header: {
              left: 'prev,next today',
              center: 'title',
              right: 'month,agendaWeek,agendaDay,listMonth'
            },
            defaultView: 'agendaDay',
            resources: [
                {
                    id: 'a',
                    fname: 'John',
                    lname: 'Smith'
                },
                {
                    id: 'b',
                    fname: 'Jerry',
                    lname: 'Garcia'
                }
            ],
            events: [
                {
                    title: 'Click for Google',
                    url: 'http://google.com/',
                    start: '2018-02-18'
                  }
            ]
          };
    }

   }

module.ts

import { FormsModule } from '@angular/forms';
import { MyDatePickerModule } from 'mydatepicker';
import { FullCalendarModule } from 'ng-fullcalendar';


HTML代码

<div *ngIf="calendarOptions">
   <ng-fullcalendar #ucCalendar [options]="calendarOptions" (eventClick)="eventClick($event.detail)" (eventDrop)="updateEvent($event.detail)"
   (eventResize)="updateEvent($event.detail)" (clickButton)="clickButton($event.detail)"></ng-fullcalendar>
 </div>


错误

ERROR in /home/mitukula/Desktop/git2/stx-ui/src/app/clientcalendar/clientcalendar.component.ts (40,13): Type '{ editable: true; eventLimit: false; header: { left: string; center: string; right: string; }; de...' is not assignable to type 'Options'.
  Object literal may only specify known properties, and 'resources' does not exist in type 'Options'.

0 个答案:

没有答案