Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/455.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 迫使ngAnimate立即作出反应_Javascript_Angularjs - Fatal编程技术网

Javascript 迫使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时

我正在使用Angular和ngAnimate开发一个网站,下面是我的代码示例

玉: 咖啡脚本:
$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