aspnetcore-angular-universal icon indicating copy to clipboard operation
aspnetcore-angular-universal copied to clipboard

JQuery plug ins not working

Open LiverpoolOwen opened this issue 6 years ago • 1 comments

I have followed the instructions for adding Jquery and its plug ins.

  • Added 'jexcel/dist/js/jquery.jexcel', 'jquery' to vendor nonTreeShakableModules
  • Uncommented the JQuery ProvidePlugin plug in
  • Added import 'jexcel/dist/js/jquery.jexcel'; to boot browser file
  • Added import * as $ from "jquery"; to the component file
  • Added $("#mytable").jexcel({}); to component file

I am seeing the following error __WEBPACK_IMPORTED_MODULE_0_jquery__(...).jexcel is not a function

Additional information:

  • I currently have pre rendering turned off
  • I am using Jquery 3.3

Am i missing something? Thanks

LiverpoolOwen avatar May 17 '18 08:05 LiverpoolOwen

It seems you are missing the TypeScript instructions. Make sure you add jquery to tsconfig.json and then create the interface in typings.d.ts. This is so typescript knows how to call and use the javascript. This article should help https://medium.com/all-is-web/angular-5-using-jquery-plugins-5edf4e642969

GRIMMR3AP3R avatar May 31 '18 13:05 GRIMMR3AP3R