What is difference between $evalAsync and $timeout?
Answer / Sarvesh Raghuvanshi
Both $evalAsync and $timeout are used for delaying the execution of code, but they have some differences:n
1. $timeout: It accepts a number as an argument specifying the time duration in milliseconds and then executes the provided function after that specified time. The $timeout service returns a promise that gets resolved when the timeout period ends.n
2. $evalAsync: It is part of the $rootScope service, which executes the given function asynchronously without any delay. It does not accept a time argument like $timeout. Unlike $timeout, $evalAsync does not return a promise.
| Is This Answer Correct ? | 0 Yes | 0 No |
What are the advantages of using angular.js framework?
How to catch and log specific angular errors in your app?
Why use node.js?
What is pipe in rxjs?
What are controllers in AngularJS?
What is the meaning of aot?
What is a good use case for ngrx/store?
Explain the architecture of angular 2?
What is deep linking in angular js?
Explain system.config.ts file used in angular?
What is the difference between a link and compile in angular?
Can angularjs connect to database?