0

I have installed jquery and imported it properly.

Somewhere in my app, I have a line as below,

 $('#myCarousel').carousel("next");

When I do npm start, it throws below error

Property 'carousel' does not exist on type 'JQuery'.

in Typescript if do $('#myCarousel')., ** it shows appropriate **intellisense but this method is not listed.

If I comment that error generating line, do npm start everything works and then if I uncomment that line and refresh it, it will work.

Its a typescript compiling error. How to resolve it????

5
  • Are you trying to use bootsrap carousel? Commented Mar 25, 2017 at 16:37
  • Yes...I'm using bootstrap carouse... Commented Mar 25, 2017 at 16:39
  • Did you import bootstrap.js? Commented Mar 25, 2017 at 16:41
  • Yes bootstrap I have added in head section of index.html. Commented Mar 25, 2017 at 16:42
  • stackoverflow.com/questions/35148628/… Are you sure that it is tsc error? Commented Mar 25, 2017 at 16:46

1 Answer 1

-1

After Angular's Final Release,

1) add following npm packages

  npm install --save-dev @types/jquery
  npm install --save-dev @types/bootstrap

2) in tsconfig.json add following entries in types array,

  "types": [
             "jquery",
             "bootstrap",  
           ]

And now you are good to go.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.