Whenever I attempt to generate a TypeScript file from a partial view (MVC .NET) that is loaded through a rest call and then appended to a div element, I encounter an error in my console.
The error message reads: Uncaught ReferenceError: xyz is not defined.
Within my partial view, the following code is present:
<script type="text/javascript>
$(document).ready(function () {
var model = @Html.GetJson(Model.x);
var view = new xyz.ExceptionView();
view.init();
});
</script>
Additionally, I've wrapped my script tag with "@section scripts {}" but this just results in no output or logging in the console.
I also failed to mention that my TypeScript file is not implementing anything, though it is included below. Could it be that I am not correctly utilizing TypeScript?
module xyz {
export class ExceptionView {
constructor() {
debugger;
}
public init = (model: any): void => {
debugger;
}
}
}