下面的代码块等待超时,然后执行带有承诺的HTTP请求,然后根据响应更改一个角物质范围变量。在输入字段上使用ng-change调用它。$scope.checkSomething = function() {
// Use a timeout to prevent a checks from going off too rapidly
这里有两个输入,一个是设置使用范围的值,另一个是在setTimeout之后设置值,但我的问题是.它不会立即显示值,我需要单击第二个输入来显示值。有什么解决办法吗?angular.module('selectExample', []) $scope.firstInput = "click the second input";
尽管我在promise.race中将超时定义为1秒,但响应等待15秒才能执行?then((statusResponse: any) => {
// Here I am getting my status response back in 15 second even if my timeout//Though I am getting the value here as my timeout value but why it is waiting for my 15 second first