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
Post a Comment