Questions tagged [angularjs-events]
19 questions
2
votes
0 answers
$document.append($rootElement); null is not an object (evaluating context.createDocumentFragment)
I'm following the migration exercise on the AngularJS docs, for input[checkbox], and it says to change
it('should update the model', inject(function($compile, $rootScope) {
var inputElm = $compile('

AncientSwordRage
- 7,086
- 19
- 90
- 173
2
votes
3 answers
ng-model-options debounce not working on blur event as expected?
I have applied ng-model-options on input with following configuration
ng-model-options="{updateOn:'default blur',debounce:{default:1000,blur:0}}"
And as per the applied configuration to the ng-model-options I am expecting the updated ng-model's…

Yogesh Jagdale
- 721
- 9
- 21
2
votes
1 answer
why a service does not receive events
I have some code that was working in a controller. I refactored and moved that functionality into a service. The code had an event listener:
$rootScope.$on( .....)
This was caught when it was in the controller, but does not catch the event when in…

Andres Gonzalez
- 2,129
- 5
- 29
- 43
2
votes
0 answers
In AngularJS, is it true that when I broadcast to all controllers during controller initialization, I have to setTimeout to broadcast?
In other words, is it true that I have to wait for the next event cycle to broadcast using $rootScope.broadcast(), so that other controllers using $rootScope.on() can pick up the broadcasted event?
It is not the usual app flow, but let's say if we…

nonopolarity
- 146,324
- 131
- 460
- 740
1
vote
2 answers
$broadcast is not working in Angularjs
I am using two controllers. When changes happen in one controllers it should get changed immediately in the other controller. I am using the $broadcast event to achive this.
My code:
My First controller
app.controller('configurationCtrl',…

Vishnu
- 745
- 12
- 32
1
vote
2 answers
stateChangeStart event in Angular doesn't fire when refreshing page
I have a custom directive:
export class XHideDirective {
static $inject = ["$rootScope"];
static $rootScope: any;
public static build($rootScope) {
var directive: ng.IDirective = {
link: (scope, element, attributes:…

Nick
- 2,877
- 2
- 33
- 62
1
vote
2 answers
Best way for communication between directives
Copied from here. May be, I can get more proper answer here!
There seem to be quite a few ways of communicating between directives. Say you have nested directives, where the inner directives must communicate something to the outer (e.g. it's been…

osmanz
- 481
- 5
- 15
0
votes
1 answer
How to handle click events from inside of the directive?
I have a modal component that takes an object with binding (ng-model). Something like:
I'm checking for $ctrl.ngModel.show to show/hide the modal:

Umut Çağdaş Coşkun
- 1,197
- 2
- 15
- 33
0
votes
0 answers
Angularjs is not updating ng-model value when the value of dropdown/select is being changed
When i am changing my option value of select it's ng-model value is not being changed.
Is this happening because of value is being changed by Jquery?
Because i read a line about angularjs from w3school that The ng-change event is only triggered if…

Utm sandeep
- 53
- 7
0
votes
1 answer
"Could not parse reminder error" - django
When jsevent triggered , it forwards link parameter to data-url attribute of a button and when user click that button it redirects to django backend view but there is a problem with parsing line of JS
$('#btn_del').attr('data-url',{% url…

BCA
- 438
- 6
- 21
0
votes
2 answers
angular watch not fired
There is 1 angular app, with 1 parent controller, and a child controller.
In the child, there is 1 $watch WATCH-CHILD for OBJ-CHILD, which triggers an $emit.
In the parent, there is a listener for the $emit, we'll call it ON-LISTENER, and a $watch…

yinonby
- 83
- 1
- 9
0
votes
1 answer
AngularJS Is it possible to listen to $destroy in another controller?
In my application, When a controller is being destroyed, is it possible to the $destroy event it emits in another controller?

Maximillion Bartango
- 1,533
- 1
- 19
- 34
0
votes
0 answers
Detect Angular view render
I'm trying to interact with a website using an userscript, but I don't know what's the cleanest possible solution for an outside source to detect the internal $viewContentLoaded event, because it does not bubble to the window object.
I tried using…

user1263513
- 91
- 1
- 8
0
votes
2 answers
How can I run function in two separated controllers in angularjs
I have two separate angularjs controllers
that are named HomeController and SearchController.
I have a function that named Search() in HomeController.
How can I run search function from searchController?

S BOT
- 13
- 4
0
votes
1 answer
Stop event listeners on '$destroy'. TypeError: $on is not a function;
I'm trying to stop all event listeners while scope is destroyed.
I get this error:
TypeError: vm.$on is not a function;
Neither vm.on(..) works
angular.module('app.layout')
.controller('DashboardController', DashboardController);
…

miuosh
- 836
- 3
- 12
- 35