Skip to main content

All Questions

Filter by
Sorted by
Tagged with
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 ...
Codewise's user avatar
  • 2,462
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"&...
Artvader's user avatar
  • 958
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> ...
Andrea Aloi's user avatar
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 ...
Cameron Rodriguez's user avatar
0 votes
0 answers
116 views

Why do I have to use $timeout to update variables in Angular?

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.8k
2 votes
1 answer
2k views

AngularJS: Why and when calling $timeout is required?

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