Javascript 迫使ngAnimate立即作出反应
我正在使用Angular和ngAnimate开发一个网站,下面是我的代码示例 玉: 咖啡脚本:Javascript 迫使ngAnimate立即作出反应,javascript,angularjs,Javascript,Angularjs,我正在使用Angular和ngAnimate开发一个网站,下面是我的代码示例 玉: 咖啡脚本: $scope.loading将其参数值设置为$scope.isLoading 例如,当服务器发送带有错误的响应时,会立即显示错误,因此,$scope.isLoading将变为false,但ngAnimate切换加载程序图标的类别需要约1秒的时间。 所以我的问题是,是否可以强制ngAnimate立即响应isLoading的更改?哪里是ng animatge?ngShow expression为true时
$scope.loading
将其参数值设置为$scope.isLoading
例如,当服务器发送带有错误的响应时,会立即显示错误,因此,$scope.isLoading
将变为false,但ngAnimate
切换加载程序图标的类别需要约1秒的时间。
所以我的问题是,是否可以强制
ngAnimate
立即响应isLoading
的更改?哪里是ng animatge
?ngShow expression为true时,ngAnimate会自动运行,因此它会切换ng hide remove和ng hide add之类的类,但如果表达式为false,在课程重新开始转换之前有一个延迟,你明白我的意思吗?
i.fa.fa-spinner.fa-spin.loader(ng-show!="isLoading")
$scope.loading true
$http(
url: $($event.target).attr('action')
method: "POST"
data: $.param($scope.user)
headers:
'Content-Type': 'application/x-www-form-urlencoded'
).then (response) ->
$scope.loading false