Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is difference between $timeout and window.setTimeout in AngularJS?



What is difference between $timeout and window.setTimeout in AngularJS?..

Answer / pintu

$timeout is an Angular service which wraps the browser's window.setTimeout() function into a try/catch block and delegates any exceptions to $exceptionHandler service. It is used to call a JavaScript function after a given time delay. The $timeout service only schedules a single call to the function.

var app = angular.module("app", []);
app.controller("MyController", function ($scope, $timeout) {
$timeout(callAtTimeout, 1000);
});
function callAtTimeout() {
console.log("Timeout occurred");
}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More AngularJS Interview Questions

What is the sequence of Angular Lifecycle Hooks?

0 Answers  


What is lazy loading images?

0 Answers  


What is scope in AngularJS?

1 Answers   Xoriant,


What are the concept of scope hierarchy? Tell me how many scope can an application have?

0 Answers  


How do you define a transition between two states in angular?

0 Answers  


Explain the concept of hierarchy?

0 Answers  


What is the traceur compiler?

0 Answers  


What types of pipes are supported in angular 2?

0 Answers  


How will you display different images based on the status being red, amber, or green?

0 Answers  


What is module in angular?

0 Answers  


Can I use angularjs with php?

0 Answers  


How would you update angular 6 to angular 7?

0 Answers  


Categories