I'm trying to use the plugin jquery tooltipster along with Angular CLI 1.5.5 and I'm having some difficulties. Basically, my code is the following:
import * as $ from 'jquery';
import 'jquery-tooltipster/js/jquery.tooltipster.min';
...
$(this.itemRef.nativeElement).tooltipster({
position: "bottom"
});
Then, in the console, I get
jquery.tooltipster.min.js:1 Uncaught ReferenceError: jQuery is not defined
I understand that it's because "jquery-tooltipster" is trying to extend "jQuery" (the global one) and does not find it but then, I have no idea how to achieve that. I think that I could use ng eject
to get the webpack.config
file and use the ProvidePlugin
, but I'd like not to eject the configuration and work with the angular-cli.json
instead.
Is there a way to make a jQuery plugin works with ng-cli or must I eject the configuration?