hsuanxyz / ion2-calendar

📅 A date picker components for ionic2 /ionic3 / ionic4
https://hsuanxyz.github.io/demo/ion2-calendar/
MIT License
555 stars 278 forks source link

How to create Modal with Ionic 4 #208

Open Frotty opened 6 years ago

Frotty commented 6 years ago

Ionic version: (check one with "x") [ ] 2.x [ ] 3.x [x] 4.x

Ion2-calendar mode: (check one with "x") [ ] components mode [x] modal mode

I'm submitting a ... (check one with "x") [x] bug report [ ] feature request [x] help me

Current behavior: The modal example doesn't work, the modal controller in ionic changed and data is now passed via componentProps instead of a 2nd options argument. Without options the modal errors out.

CalendarModal_Host.ngfactory.js? [sm]:1 ERROR TypeError: Cannot read property 'defaultScrollTo' of undefined
    at CalendarService.push../node_modules/ion4-calendar/dist/services/calendar.service.js.CalendarService.safeOpt (calendar.service.js:38)
    at CalendarModal.push../node_modules/ion4-calendar/dist/components/calendar.modal.js.CalendarModal.init (calendar.modal.js:31)
    at CalendarModal.push../node_modules/ion4-calendar/dist/components/calendar.modal.js.CalendarModal.ngOnInit (calendar.modal.js:21)

Expected behavior: Modal should work just like in v3

Steps to reproduce: Start a blank ionic project and try to show a modal calendar

Related code:

    const myCalendar = await this.modalCtrl.create({
      component: CalendarModal,
    });

Other information:

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

Ionic Framework               : @ionic/angular 4.0.0-beta.13
ulesta commented 6 years ago

Hey @Frotty, this lib doesn't support Ionic 4 as of yet. I've created a PR for the Ionic 4 migration here: https://github.com/HsuanXyz/ion2-calendar/pull/200

We're still waiting on @HsuanXyz to review our changes but you can use our forked release branch in the meantime: https://github.com/UltimateSoftware/ion2-calendar/tree/release/ionic-4

Also, I've yet to update the docs, but the demos and samples have been updated for usage in Ionic 4.

heyligengregory commented 5 years ago

Any update about Ionic 4 support ?