首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >Angular Full Calendar For add ng-Bootstrap模式弹出窗口

Angular Full Calendar For add ng-Bootstrap模式弹出窗口
EN

Stack Overflow用户
提问于 2017-12-21 19:43:46
回答 1查看 1.5K关注 0票数 0

我使用我的大学项目的角度完整的日历,我想知道如何添加模态弹出的日历事件看我的形象,日历工作良好,但我不知道如何添加模态弹出这个事件,

请帮我这个好吗?谢谢

我想知道如何将该事件添加到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>
EN

回答 1

Stack Overflow用户

发布于 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将使用事件数据来呈现视图。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47924268

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档