tui.calendar icon indicating copy to clipboard operation
tui.calendar copied to clipboard

Doesn't work with Angular

Open micobarac opened this issue 1 year ago • 3 comments

I created a new Angular 14 application and added @toast-ui/calendar dependency.

<div #calendar></div>

import { AfterViewInit, Component } from '@angular/core';
import Calendar from '@toast-ui/calendar';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss'],
})
export class AppComponent implements AfterViewInit {
  ngAfterViewInit(): void {
    const calendar = new Calendar('#calendar', {
      usageStatistics: false,
    });
  }
}

@import "@toast-ui/calendar/dist/toastui-calendar.min.css";

The application won't compile, throwing a bunch of errors:

Error: node_modules/@toast-ui/calendar/types/factory/calendarCore.d.ts:3:24 - error TS2307: Cannot find module '../model/eventModel' or its corresponding type declarations.

3 import EventModel from "../model/eventModel";
                         ~~~~~~~~~~~~~~~~~~~~~


Error: node_modules/@toast-ui/calendar/types/factory/calendarCore.d.ts:5:31 - error TS2307: Cannot find module '../utils/eventBus' or its corresponding type declarations.

5 import type { EventBus } from "../utils/eventBus";
                                ~~~~~~~~~~~~~~~~~~~


Error: node_modules/@toast-ui/calendar/types/factory/calendarCore.d.ts:9:82 - error TS2307: Cannot find module '../types/store' or its corresponding type declarations.

9 import type { CalendarState, CalendarStore, Dispatchers, InternalStoreAPI } from "../types/store";
                                                                                   ~~~~~~~~~~~~~~~~


Error: node_modules/@toast-ui/calendar/types/types/events.d.ts:2:29 - error TS2307: Cannot find module '../model/eventModel' or its corresponding type declarations.

2 import type EventModel from "../model/eventModel";
                              ~~~~~~~~~~~~~~~~~~~~~


Error: node_modules/@toast-ui/calendar/types/types/events.d.ts:3:31 - error TS2307: Cannot find module '../model/eventUIModel' or its corresponding type declarations.

3 import type EventUIModel from "../model/eventUIModel";
                                ~~~~~~~~~~~~~~~~~~~~~~~


Error: node_modules/@toast-ui/calendar/types/types/events.d.ts:5:29 - error TS2307: Cannot find module '../utils/collection' or its corresponding type declarations.

5 import type Collection from "../utils/collection";
                              ~~~~~~~~~~~~~~~~~~~~~


Error: node_modules/@toast-ui/calendar/types/types/events.d.ts:6:32 - error TS2307: Cannot find module './components/common' or its corresponding type declarations.

6 import type { StyleProp } from "./components/common";

Screenshot 2022-12-13 at 11 19 09

There are no model and util directories inside library.

micobarac avatar Dec 13 '22 10:12 micobarac

Also, ts-essentials is missing, I had to add it manually.

micobarac avatar Dec 13 '22 10:12 micobarac

@micobarac

Thanks for the report. We need to improve the process of generating type definition files.

You can turn on the skipLibCheck option for your project as a workaround.

https://www.typescriptlang.org/tsconfig#skipLibCheck

adhrinae avatar Dec 14 '22 00:12 adhrinae

Any update on this? Angular integration is still not possible...

micobarac avatar Jul 26 '23 07:07 micobarac