TypeScript with Jquery -


i getting error "uncaught referenceerror: $ not defined" please find code below.

///<reference path="jquery.d.ts" />  class test {     name: string;      constructor() {         this.name = "gowtham";     }      dispname() {         alert("name :" + this.name);     } }  $(document).ready(function () {      debugger;     var test = new test();     $('#test').on('click', function() {         debugger;         test.dispname();     });  }); 

i having referance reference path="jquery.d.ts" in .ts file. missing here .?

you're getting runtime error because haven't loaded jquery properly, if issue typings would've seen compiler error.

see existing question: uncaught referenceerror: $ not defined?


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -