Due to certain reasons, we have decided to begin our project with TS rather than JS.
We are facing issues with the variables set in the MVC Views, which are established by the Model of each View.
For example, tes.cshtml:
@model Testmodel
<script>
var test = {};
var test.myProp = @Model.Testproperty;
<script>
However, I encountered an error in my test.ts when attempting to access the test variable because my TypeScript file is not aware of it.
Could this be a misunderstanding in the architecture? Is there a solution to this issue?
To be honest, we have approximately 100 variables defined or created in RazorViews, including many Resource Variables from our resx files that we may need for a JavaScript alert, for instance!