Questions tagged [angularjs-events]
19 questions
0
votes
0 answers
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 using broadcast is that you don't have to use watcher…

Merlin
- 4,907
- 2
- 33
- 51
0
votes
0 answers
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 problem is, when I change the scope ($scope.test…

Filip Novotny
- 397
- 1
- 4
- 9
0
votes
1 answer
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 {
return this;
}
doStuff() {
…

A T
- 13,008
- 21
- 97
- 158
-2
votes
1 answer
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',[]);
fileUpload.directive('fileUpload', function () {
…

krs8888
- 1,239
- 4
- 19
- 26