[英]Is it important to use $timeout in angularJS while using Async and Await ing Asp.net Web API?
I just want to know if it is required to use $timeout
in AngularJS
as a synchronous way while I'm using Async
and Await
in my Serverside which is the Asp.Net Web Api
. 我只想知道在我的服务器端(即
Asp.Net Web Api
使用Async
和Await
,是否需要在AngularJS
使用$timeout
作为同步方式。
Please explain me and let me understand if I'm going to use $timeout
, Async
and Await
together. 请向我解释,让我了解是否要一起使用
$timeout
, Async
和Await
。
Async\\Await
are server side
operators that help you do things async in your server. Async\\Await
是server side
运算符,可帮助您在服务器中执行异步操作。
$timeout
is a angularjs
provider that wraps setTimeout
and uses the $apply
function to sync things in the angular world ( $apply
calls digest
). $timeout
是angularjs
提供程序,它包装setTimeout
并使用$apply
函数来同步角度世界中的事物( $apply
调用digest
)。
If you are looking for a way to be async
on the client side you should read about promises
and deferred
objects - This is the way to work async
on the client (it doesn't matter if I'm async on server or not). 如果您正在寻找一种在客户端
async
的方法,那么您应该阅读有关promises
和deferred
对象的信息-这是在客户端上async
工作的方法(无论我是否在服务器上异步都没有关系)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.