从Visual Studio移动到WebStorm后出现AngularJS语法错误(键入脚本编码)
我刚刚将我的Typescript/AngularJS应用程序从VisualStudio移动到WebStorm。以前运行的一些代码现在出现如下错误:从Visual Studio移动到WebStorm后出现AngularJS语法错误(键入脚本编码),angularjs,typescript,webstorm,Angularjs,Typescript,Webstorm,我刚刚将我的Typescript/AngularJS应用程序从VisualStudio移动到WebStorm。以前运行的一些代码现在出现如下错误: <div class="flexUserLogin" ng-controller="authenticationHomeController" style="flex-direction: column; flex: 1; margin-left: 3rem;">
<div class="flexUserLogin"
ng-controller="authenticationHomeController"
style="flex-direction: column;
flex: 1;
margin-left: 3rem;">
<div class="authTabs">
<div class="w2r"></div>
<div id="login" class="h2"
ng-class="{'enabled':as.authTab == AuthTabs.Login,
'disabled': as.authTab != AuthTabs.Login}"
ng-click="as.setAuthTab(AuthTabs.Login)">
更新:
我注意到更改为$scope.bs,然后将html中的引用更改为“bs”可以正常工作。“as”不是一个保留词,所以我很好奇是否有其他人看到了这一点并将其视为一个问题。登录为,请投票可能是WebStorm中的一个bug?只是好奇——如果您使用
controllerAs
语法而不是将as
添加到范围中,它会消失吗?我只是注意到它似乎对“as”这个词感到不安。将其更改为“bs”或其他任何形式,效果良好。现在我确信这是一个WebStorm bug。请把它交给他们,好的。谢谢
class AuthenticationHomeController {
static $inject = [
"$scope",
"authService"
];
constructor(
public $scope,
public as:IAuthService
) {
$scope.as = as;
as.setAuthTab(AuthTabs.Login);
}
}