0

I am trying to load jquery and jqueryUI from CDN in my typescript file, I have added typings for both

npm install --save @types/jquery@2 npm install --save @types/jqueryui

config.json look like this

enter image description here

In my type script file, I am trying to reference them with these lines

import * as $ from 'jquery'
import * as ui from 'jqueryui'

jquery is loading fine but jqueryUi is giving error

enter image description here

i can also see that both typings have been installed successfully

enter image description here

How can I fix this issue? here is my tsconfig.json enter image description here

5
  • You are importing it incorrectly. You may find this instructive: stackoverflow.com/questions/43323515/… Commented Apr 26, 2018 at 4:41
  • declare $:any; for jquery in your typescript file Commented Apr 26, 2018 at 4:45
  • getting error after import * as $:any from 'jquery'; "any only refers to a type but it is being used as value" Commented Apr 26, 2018 at 4:49
  • @aluan that solution installing jquery and jqueryUi as packages but in my case I don't want to install any package and want to refer from CDN. Commented Apr 26, 2018 at 4:50
  • any help please.. Commented May 1, 2018 at 0:01

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.