---
title: "What is $timeout Service in AngularJS"  
description: "What is $timeout Service in AngularJS"  
author: "Revati S Misra"  
published: 2024-05-15  
updated: 2024-05-16  
canonical: https://www.mindstick.com/forum/160656/what-is-timeout-service-in-angularjs  
category: "angular js"  
tags: ["angular js", "angularjs service"]  
reading_time: 1 minute  

---

# What is $timeout Service in AngularJS

What is $[timeout](https://www.mindstick.com/forum/159429/sql-query-returns-a-timeout-expired-error) [Service](https://www.mindstick.com/articles/105963/online-thesis-writing-service-for-college-kids-with-disabilities) in [AngularJS](https://www.mindstick.com/forum/33926/use-angularjs-without-scope-in-mvc)

## Replies

### Reply by Ashutosh Patel

In AngularJS, the **$timeout** service is used for delaying the execution of a function. It's similar to JavaScript's native **setTimeout** function but integrated into the AngularJS framework, allowing you to work with AngularJS's digest cycle

```javascript
$timeout(function(){
    $scope.Label = "Show after two seconds";
}, 2000);
```

## Example-

```javascript
<!DOCTYPE html>
<html ng-app="myApp">
<head>
    <title>$interval Service Example</title>
    <meta name='viewport' content='width=device-width, initial-scale=1'>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js"></script>
</head>
<body>

<div ng-controller="myController">
    <div class="container my-4">
        <div class="text-center">
            <p class="fw-semibold">{{Label}}</p>
        </div>
    </div>
</div>

<script>
angular.module('myApp', [])
.controller('myController', function($scope, $timeout) {

    $scope.Label = "Hello Developer!";

    // update the Label text after 2 second
    $timeout(function(){
        $scope.Label = "How are you?";
    }, 2000);
});

</script>
</body>
</html>
```

## Output-

## Hello Developer!

*after two seconds*

## How are you?


---

Original Source: https://www.mindstick.com/forum/160656/what-is-timeout-service-in-angularjs

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
