Reputation: 11221
I am trying to use jQuery UI in StackBlitz.
I am also trying to install it as a dependency and without a script tag.
I understand that I have to add @types/jquery and @types/jqueryui as dependencies.
But when I add this in the index.ts
import $ from "jquery";
import "jqueryui";
I get the error: "jQuery is not defined"
Upvotes: 0
Views: 1008
Reputation: 11221
This code seems to do the trick:
import $ from "jquery";
declare var global: any
global.jQuery = $;
import "jqueryui";
Here is a screenshot of the dependencies:
Upvotes: 2