我使用我的大学项目的角度完整的日历,我想知道如何添加模态弹出的日历事件看我的形象,日历工作良好,但我不知道如何添加模态弹出这个事件,
请帮我这个好吗?谢谢
我想知道如何将该事件添加到ng-bootstrap-Modal
这是我的代码
index.component.ts
export class IndexComponent {
calendarOptions:Object = {
height: 'parent',
fixedWeekCount : false,
defaultDate: '2016-09-12',
editable: true,
eventLimit: true, // allow "more" link when too many events
events: [
{
title: 'All Day Event',
start: '2016-09-01'
},
{
id: 999,
title: 'Repeating Event',
start: '2016-09-09T16:00:00'
},
}
index.component.html
<div class="container-fluid">
<div class="calendar">
<angular2-fullcalendar [options]="calendarOptions" (initialized)="onCalendarInit($event)"></angular2-fullcalendar>
</div>
</div>
发布于 2018-06-06 08:53:20
这可以用bootstrap来完成,比如ngx-bootstrap,modal。
这里有一个使用ngx-bootstrap模式的链接:ngx-bootstrap-how-to-open-a-modal-from-another-component
您可以使用eventClick
启动该模式:
eventClick(model: any) {
// this is used to pass event data to modal component
const initialState = { apptEvent: model.event};
this.bsModalRef =
this.modalService.show(ModalComponent,
Object.assign({}, this.modalConfig, { class: 'modal-md',
initialState }));
this.bsModalRef.content.onClose.subscribe(result => {
// close the modal
this.bsModalRef.hide();
})
};
ModalComponent
将使用事件数据来呈现视图。
https://stackoverflow.com/questions/47924268
复制相似问题