Skip to main content
Stack Overflow for Teams is now Stack Internal: See how we’re powering the human intelligence layer of enterprise AI. Read more >
Filter by
Sorted by
Tagged with
1 vote
1 answer
106k views

I have a button for which I have set ng-click="refresh()". The console logs before the timeout function logs correctly but the console log inside the $timeout block and after the block doesn'...
cmgchess's user avatar
  • 10.3k
1 vote
2 answers
148 views

Following is what I'm trying to do. When the first timeout is forcibly cancelled, I want to initiate the second timeout function, without the lag that already exists, had the timeout not been ...
Siena's user avatar
  • 777
1 vote
1 answer
1k views

I want to add some delay in angularjs. So that it can fetch data from api. Because my api is heavy. I am calling this function. Basically i want some delay to load page so that my api work properly. I ...
Devesh Khosla's user avatar
1 vote
1 answer
736 views

I am injecting $timeout into the following directive but it is not defined. The following code prints undefined to the console and throws TypeError: $timeout is not a function; export default class ...
user avatar
9 votes
3 answers
10k views

Basically, I want to measure the width of the element after angular has manipulated the DOM. So I would like to use $timeout for that, but it keeps getting me errors. HTML <div ng-app="github"&...
Artvader's user avatar
  • 958
0 votes
2 answers
640 views

What I'm trying to achieve is very straight forward but I'm confused. I'm trying to make a queue that holds hospital patients, they will be logged in the system, added to an array (FIFO) and then ...
Alexander P.'s user avatar
2 votes
4 answers
450 views

I want to make a div appear 10s after the page has loaded. I would like to use angular. <div class="appearingitem" ng-show="timeduration"></div> Any ideas how i might accomplish this? Is ...
andrea's user avatar
  • 103
3 votes
3 answers
6k views

I have this code for image slider and next prev and auto change the image function scope.next = function () { scope.currentIndex < scope.images.length - 1 ? scope.currentIndex++ : scope....
Syd Amir's user avatar
  • 475
4 votes
2 answers
841 views

I have a few spots where things happen in the UI on a delay using $timeout or $interval. Here's a simplified example: Controller code: $timeout(function() { $scope.showElement = true; }, 10000); ...
peteallen's user avatar
  • 2,553
2 votes
1 answer
2k views

I'm trying to create my own image carousel as an angularjs directive; I want to keep it as lightweight and unopinionated as possibile, so I thought I'd just create a <carousel></carousel> ...
Andrea Aloi's user avatar
1 vote
1 answer
2k views

I am new to angular so I need detailed solution to this question. I have seen a lot of answers but not according to my situation. I have a service: function ticketService($resource, globals) { ...
Adnan Ali's user avatar
  • 2,980
3 votes
2 answers
4k views

I'm doing an AJAX request for data that is used in the view for generation of a list. I need to know when the $scope is updated and when the view is rendered after a successful response received, so ...
Galya's user avatar
  • 6,364
0 votes
1 answer
902 views

Not sure if everything is wired up here correctly. The objective is to call the nextSlide function, for it to change the class, wait a second, then incrament the current picture by 1, and then change ...
Cameron Rodriguez's user avatar
3 votes
1 answer
7k views

I'm experiencing some problems with AngularJS and $timeout. I need to run some code, after the page is loaded. Http.get() loads items and ng-repeat displays them in table. Then I need to run the code ...
Mara's user avatar
  • 118
0 votes
0 answers
532 views

I have a service that needs to call the database through AJAX and this is the test for it: describe 'Cep service', -> cep = undefined $timeout = undefined beforeEach(module('cep')) ...
pocesar's user avatar
  • 7,070
0 votes
0 answers
116 views

I have a directive in a directive. In the deepest directive I have this: directive B: scope.onChange = function () { scope.ngModel = scope.selectedItem.Id; $timeout(function () { ...
Martijn's user avatar
  • 24.9k
1 vote
1 answer
496 views

I'm new to AngularJS. I'm looking at using the $timeout service. I've read that one of the reasons for using $timeout over the JavaScript setTimeout function is because changes to variables in the $...
JQuery Mobile's user avatar
0 votes
0 answers
294 views

As part of learning AngularJS, I decided to rewrite Cookie Clicker using it. I have a controller set up and it has (among other things) $scope.Cookies, $scope.CPS (to represent the cookies per second),...
Corey Ogburn's user avatar
  • 24.9k
1 vote
1 answer
3k views

Is there something special I need to do to access objects inside $timeout functions? I get errors saying routes is undefined when I try and access it in the $timeout function, but outside the $...
andro1d's user avatar
  • 558
0 votes
1 answer
603 views

I am trying to implement a function within the controller which will be incharge of showing various notification to the user. the problem is that I want the duration to be a function parameter, and ...
Oleg Belousov's user avatar
9 votes
1 answer
7k views

I have an "ng-init" directive in my HTML that initializes the value of "data.id" in my Angular.js data model. Let's say for now that I can't change how this works. Now, I want to make an HTTP request ...
Eugene Osovetsky's user avatar
182 votes
2 answers
75k views

I've been using AngularJS for a little while now, and have found the need to use $timeout every once in a while (Seems to usually be to init a jQuery plugin). Recently, I've been trying to get a ...
dnc253's user avatar
  • 40.4k
2 votes
1 answer
2k views

Live Demo I created a confirmationDialogHeader directive which is used like so: <ul> <li ng-repeat="item in items"> {{item}} <button class="btn btn-mini" ...
Misha Moroshko's user avatar
2 votes
1 answer
2k views

I think this might be quite common use-case with any angular app. I am simply watching some objects on my scope that are changed as part of several digest cycles. After digesting them (changing their ...
honzajde's user avatar
  • 2,448