C# 使用angularjs和asp.net mvc时如何防止运行时错误

C# 使用angularjs和asp.net mvc时如何防止运行时错误,c#,asp.net,angularjs,asp.net-mvc,testing,C#,Asp.net,Angularjs,Asp.net Mvc,Testing,我正在开发一个使用ASP.NETMVC和angularjs的系统 有时,由于拼写错误,.cshtml文件错误地引用了角度控制器中不存在的函数 这里有一个例子。 第二个按钮使用函数SetTxt,它应该是SetText <button ng-click="SetText('account')">Click Here</button> <button ng-click="SetTxt('account')">Click Here</button> a

我正在开发一个使用ASP.NETMVC和angularjs的系统

有时,由于拼写错误,.cshtml文件错误地引用了角度控制器中不存在的函数

这里有一个例子。 第二个按钮使用函数SetTxt,它应该是SetText

<button ng-click="SetText('account')">Click Here</button>

<button ng-click="SetTxt('account')">Click Here</button>

app.controller('MyController', '$scope', function ($scope) {
   $scope.SetText = function (text) {
      $scope.currentText = text;
   };
}
点击这里
点击这里
app.controller('MyController','$scope',函数($scope){
$scope.SetText=函数(文本){
$scope.currentText=文本;
};
}
在部署和手动QA之前,是否有一种自动化且轻量级的方法/工具来识别所有html页面中的此类错误


谢谢!

由开发人员进行单元测试,并在发布前进行适当的内部QA。