I am new to this so bear with me. What i am trying to do is getting jquery to work in a typescript code file.
How should i refer to the .d.ts code?
I have tried the following:
import * as $ from "jquery";
this gives me the error: "'jquery' resolves to non-module entity and cannot be imported with this construct"
then i tried:
import $ = require("jquery");
this gives the following error: Import assignment cannot be used when targeting EcmaScript 2015 modules
How do I go about this to make jquery functions work in my typescript code? Are there other ways?
I am using typescript 2.5.2, module system ES2015, EcmaScript 6 and @types/jquery.
EDIT
i tried import * as $ from "../wwwroot/lib/jQuery/dist/jquery.min.js";, now it gives me the error "... has been resolved ... but --allowJs is not set",I dont have a tsconfig.json yet, I probably need it for the --allowJs command, is that right?
import * as $ from "path/to/jquery";import * as jQuery from 'jquery'. It should work if jQuery is installed through NPM.import * as $ from "../node_modules/@types/jquery";and import * as $ from"../node_modules/@types/jquery/index.d.ts";and it doesnt work either