I am trying to use the new datepicker for angular with metronic 9.3.9:
https://keenthemes.com/metronic/tailwind/docs/components/date-picker
Adding
<!--begin::Basic Calendar-->
<div data-kt-date-picker="true" id="calendar">
</div>
<!--end::Basic Calendar-->
to any page does not show the calendar. The api does not specify an init() function that should be called.
Am I missing something?
Hi Samuel
Sorry for the delay. In Angular, you need to initialize Metronic components after the view is ready. Use the MetronicInitService in your component's AfterViewInit lifecycle hook. Can you please try this?
/metronic-tailwind-angular/src/app/app.component.ts
constructor() {
this.router.events.pipe(filter(e => e instanceof NavigationEnd)).subscribe(() => {
this.updateDemo();
// Delay initialization to ensure view is rendered
setTimeout(() => {
this.metronicInitService.init();
}, 0);
});
this.updateDemo();
}