javascript - TypeScript: the variable is defined on the MVC page -
How can I make TypeScript aware that the variable is defined in cshtml file? Can I add a reference inside the TS file?
You can do this in a typewrite file or in one. D.ts file:
var to MVC: declare string;
It does not produce any code, but it conveys to the compiler that a variable named "fromMvc" exists. After declaring that you can use it as a normal variable.
Comments
Post a Comment