while i use the typescript 2
import $ from 'jquery'
{
$.getJSON(...)//works
$(...)//error; tip is $ is an Object
}
i found the document described that it is unable to use the module as a function.
but i do want it works
i also try the usage const $ = require('jquery'), and it does work, but it has no tips at all.
This is going to depend on your loader and module format. What are they?
By the way,
const $ = require('jquery');
never provides intellisense.
it needs to be
import $ = require('jquery');
Also, is this a runtime issue or is the code working but you are getting a compile time error?
Please ask questions on e.g. Stack Overflow. This is not a general support forum.
@RyanCavanaugh Sorry, I didn't mean to indulge this.
No worries @aluanhaddad!
Yeah no trouble, if people want to ask questions and other people want to answer them that's cool, we just need to set expectations that TS members don't have resources to help out with everyday stuff. We can't seem to stop people from asking anyway :smile:
any how , i fixed the question
$ can be used like a normal way like in javascript
Most helpful comment
No worries @aluanhaddad!