What's the best way to import a javascript jQuery's function (function($) ...)(JQuery)
into Angular2?
In the project I'm using the default configuration of AngularCLI so it's using webpack and typescript.
I should import https://github.com/digitalbreed/jquery.fbmessenger that works invoking some function
var element = $('.phone')
// Initialize the plugin
.fbMessenger({
// options go here
});
element.fbMessenger('start', { delay: 1000 })
In the project following some instructions on Internet encounter some problems and I don't know what's the best way to do it:
Using UpgradeModule form the Angular2 Doc there are an error, on @angular\core thare aren't StaticProvider
Importing jquery.fbmessenger like
import * as $ from "jquery"
how I could refear fbMessenger?import * as fbMessenger from "jquery.fbmessenger"
doesn't let me invoke fbMessenger as a functionLike jQuery I have to write a file on @type for the function? Or should I insert an instruction on type.d.ts? So how could I do it?
Thank's for your help.