19 questions
0
votes
1
answer
220
views
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:
<modal ng-model="modals.createContact"></modal>
I'm checking for $ctrl.ngModel.show to show/hide the ...
0
votes
0
answers
46
views
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 ...
0
votes
1
answer
177
views
"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
...
2
votes
0
answers
125
views
$document.append($rootElement); null is not an object (evaluating context.createDocumentFragment) [duplicate]
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('...
1
vote
2
answers
194
views
$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 ...
-1
votes
2
answers
304
views
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 ...
2
votes
3
answers
6k
views
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-...
0
votes
1
answer
663
views
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?
0
votes
0
answers
90
views
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 ...
0
votes
2
answers
35
views
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 ...
0
votes
1
answer
380
views
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('...
2
votes
1
answer
175
views
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 ...
0
votes
0
answers
2k
views
Sharing data between controllers using $broadcast
To share data between controllers it is common to use service.
I found that using $rootScope.$broadcast is really convenient if the data I have to share is a [] or an {}.
For me the advantage of ...
-2
votes
1
answer
298
views
directive to directive communication using broadcast angularjs
I have two directives and need to pass value from one directive after a post request into another directive.
The first directive looks like
var fileUpload = angular.module('fileUploadDirective',[]);...
0
votes
0
answers
202
views
Propagating events from d3.js to angular without resorting to scope.apply
I am using the d3.js library inside an angular 1.x controller.
My d3.js library creates a click event on a div and when the div is clicked, it updates something on the angular controller's scope.
The ...
1
vote
2
answers
718
views
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 =...
1
vote
2
answers
1k
views
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 ...
0
votes
1
answer
1k
views
AngularJS 1 with TypeScript: where in controller to put $rootScope.on?
Service
export class RandomServiceName implements ng.IServiceProvider {
/* @ngInject */
constructor(private $rootScope: ng.IRootScopeService) {
}
public $get(): RandomServiceName {
...
2
votes
0
answers
197
views
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?
...