angular2gridster icon indicating copy to clipboard operation
angular2gridster copied to clipboard

ERROR TypeError: Object(...) is not a function

Open Pravin-Chopde opened this issue 6 years ago • 3 comments

ERROR TypeError: Object(...) is not a function at new Draggable (angular2gridster.js:3513) at GridsterItemPrototypeDirective.enableDragDrop (angular2gridster.js:4922) at eval (angular2gridster.js:4796) at ZoneDelegate.invoke (zone.js:388) at Zone.run (zone.js:138) at NgZone.runOutsideAngular (core.js:4708) at GridsterItemPrototypeDirective.ngOnInit (angular2gridster.js:4795) at checkAndUpdateDirectiveDynamic (core.js:12440) at checkAndUpdateNodeDynamic (core.js:13957) at checkAndUpdateNode (core.js:13881)

Pravin-Chopde avatar Jul 12 '18 15:07 Pravin-Chopde

Hi, which version of angular2gridster do you use? Template with controller configuration would be helpful.

swiety85 avatar Jul 13 '18 17:07 swiety85

I am using v6.0.1 ("angular2gridster": "^6.0.1",)

dashboard-creator.component.zip

Pravin-Chopde avatar Jul 16 '18 11:07 Pravin-Chopde

I noticed that in your component your imports use relative paths to "node_modules" directory. Can you change:

import { GridsterComponent, IGridsterOptions, IGridsterDraggableOptions } from '../../../node_modules/angular2gridster';

to

import { GridsterComponent, IGridsterOptions, IGridsterDraggableOptions } from `angular2gridster';

Remember to also import the GridsterModule in your app module:

import { GridsterModule } from 'angular2gridster';
...
@NgModule({
  ...
  imports: [
    ...
    GridsterModule.forRoot()
  ]
})
export class AppModule { }

Let me know if this solves your problem. If not I will investigate it further.

swiety85 avatar Jul 19 '18 19:07 swiety85