angular-calendar icon indicating copy to clipboard operation
angular-calendar copied to clipboard

Import and use CalendarResizeHelper and CalendarDragHelper

Open michelebombardi opened this issue 7 years ago • 4 comments

I'm trying to implement my own drag and resize featured component but when I try to import CalendarResizeHelper and CalendarDragHelper in this way:

import { CalendarResizeHelper } from 'angular-calendar/modules/common/calendar-resize-helper.provider';
import { CalendarDragHelper } from 'angular-calendar/modules/common/calendar-drag-helper.provider';

the angular compiler returns the following errors:

ERROR in ./lib/modules/scheduler/calendar-scheduler-view.component.ts 
Module not found: Error: Can't resolve 'angular-calendar/modules/common/calendar-drag-helper.provider' in 'C:\Code\AngularCliProjects\angular-calendar-scheduler\lib\modules\scheduler'\scheduler'

ERROR in ./lib/modules/scheduler/calendar-scheduler-view.component.ts                                                                                                       es\scheduler'
Module not found: Error: Can't resolve 'angular-calendar/modules/common/calendar-resize-helper.provider' in 'C:\Code\AngularCliProjects\angular-calendar-scheduler\lib\modules\scheduler'

In the previsous version of your library I didn't experienced this problem. How can I import those components now?

To reproduce the issue: try to import CalendarResizeHelper and CalendarDragHelper as snown above.

Versions

  • @angular/core: 6.0.3
  • angular-calendar: 0.26.0
  • Browser name and version: Chrome 69.0.3497.81

michelebombardi avatar Sep 13 '18 10:09 michelebombardi

@bm-software You can import as shown below (as a temporary workaround)

import { CalendarDragHelper } from 'angular-calendar/esm2015/modules/common/calendar-drag-helper.provider';
import { CalendarResizeHelper } from 'angular-calendar/esm2015/modules/common/calendar-resize-helper.provider';

halilibrahim avatar Oct 11 '18 08:10 halilibrahim

@halilibrahim Thank you very much!

michelebombardi avatar Oct 11 '18 11:10 michelebombardi

Hi, with version 0.30.1 I run into this issue again. I was able to import CalendarResizeHelper and CalendarDragHelper in this way:

import { CalendarDragHelper } from 'angular-calendar/modules/common/calendar-drag-helper.provider';
import { CalendarResizeHelper } from 'angular-calendar/modules/common/calendar-resize-helper.provider';

but when I try to build my library it says:

./lib/modules/scheduler/calendar-scheduler-view.component.ts:3:0-99 - Error: Module not found: Error: Package path ./modules/common/calendar-drag-helper.provider is not exported from package E:\Programmazione\Projects\NodeJsProjects\angular-calendar-scheduler\node_modules\angular-calendar (see exports field in E:\Programmazione\Projects\NodeJsProjects\angular-calendar-scheduler\node_modules\angular-calendar\package.json)

./lib/modules/scheduler/calendar-scheduler-view.component.ts:4:0-103 - Error: Module not found: Error: Package path ./modules/common/calendar-resize-helper.provider is not exported from package E:\Programmazione\Projects\NodeJsProjects\angular-calendar-scheduler\node_modules\angular-calendar (see exports field in E:\Programmazione\Projects\NodeJsProjects\angular-calendar-scheduler\node_modules\angular-calendar\package.json)

Is there any solution?

michelebombardi avatar Sep 06 '22 16:09 michelebombardi

@michelebombardi I ran into the same issue. Seems like CalendarDragHelper and CalendarResizeHelper are meant to be only internal to angular-calendar, not to be used by us. That's why they are not exported from CalendarCommonModule.

You have three options now:

  1. Contribute with a pull request to angular-calendar and see if @mattlewis92 accepts it. Then pull the new version into your project. (Content of the pull request would be to add CalendarDragHelper and CalendarResizeHelper to the exports of CalendarCommonModule)
  2. Fork the project, make the change described in (1), and in your project use your own fork instead of the official release of angular-calendar.
  3. Quick and dirty: Copy the source code files CalendarDragHelper and CalendarResizeHelper into your project. Change the imports to point to your local copies instead of the library. (May take multiple iterations, in case you need to copy other files that these two depend on.)

Legal disclaimer: As far as I understand the MIT license this project is published under, copying the code is allowed. But don't take my word for it, check for yourself.

tbelmega avatar May 19 '23 22:05 tbelmega