All Questions
Tagged with angularjs-timeout angularjs
23 questions
1
vote
1
answer
105k
views
In an Angular.js controller's scope function code doesn't run below a $timeout statement inside
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'...
1
vote
2
answers
147
views
Can we update $timeout in AngularJS?
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 ...
1
vote
1
answer
1k
views
Add Delay in angularjs
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 ...
1
vote
1
answer
735
views
AngularJS: Injecting $timeout not available in directive
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 ...
9
votes
3
answers
10k
views
How do I use $timeout service in a Directive?
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"&...
0
votes
2
answers
639
views
Create automatic javascript queue with time out to shift items
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 ...
2
votes
4
answers
448
views
Trigger ng-show after delay
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 ...
3
votes
3
answers
6k
views
How can clear $timeout in angularjs
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....
4
votes
2
answers
839
views
Simulate the passage of time in protractor?
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);
...
2
votes
1
answer
2k
views
AngularJS: avoid using $timeout to wait for image loading completion
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> ...
1
vote
1
answer
2k
views
Cancel a resource request in angular
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) {
...
3
votes
2
answers
4k
views
Is any event "on $scope digest finished" or "on view refreshed" in Angular.js?
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 ...
0
votes
1
answer
902
views
AngularJS: $timeout within directive's controller using "this"
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 ...
3
votes
1
answer
7k
views
AngularJS $timeout sometimes works sometimes doesn't
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 ...
0
votes
0
answers
532
views
Unit testing services with mocha (no e2e test) on AngularJS with $timeout never finishes
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'))
...