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

Popular posts from this blog

mysql - How to enter php data into a html multiple select box -

java - Can't add JTree to JPanel of a JInternalFrame -

c++ - Cassandra datastax cpp driver - avoiding unnecessary copies -