Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find symbol '$'

I'm referencing jquery in my typescript file but visual studio is telling me that it...

Could not find symbol '$'

Any ideas how to get rid of these errors?

ps - I am referencing jquery at the top of my typescript file as follows...

/// <reference path="./js/lib/jquery.min.js" />
like image 825
pmcilreavy Avatar asked Sep 08 '13 23:09

pmcilreavy


1 Answers

You need to reference the jquery definition file jquery.d.ts, not the javascript file. So :

/// <reference path="./jquery.d.ts" />

You can get this file from here : https://github.com/borisyankov/DefinitelyTyped/tree/master/jquery

You can see sample usage here : https://github.com/borisyankov/DefinitelyTyped/blob/master/jquery/jquery-tests.ts#L1

like image 78
basarat Avatar answered Sep 30 '22 10:09

basarat