Questions tagged [angular-broadcast]

Angularjs event broadcasting method

Represents the broadcast method provided by to broadcast user defined events. From AngularJS $scope API Reference - $broadcast

Dispatches an event name downwards to all child scopes (and their children) notifying the registered $rootScope/Scope listeners.

45 questions
0
votes
0 answers

How to set same broadcast in two places

I have a piece of code that needs to be invoked after execution of some other code. i'm using broadcast for this. I need to invoke the same code from 2 different places. Now that is not working for me. My code is Broadcast…
I'm nidhin
  • 2,592
  • 6
  • 36
  • 62
0
votes
1 answer

How to listen to $rootscope.$broadcast with $scope

My $scope.$on(... doesn't seem to be picking up the broadcast. I have an interceptor to capture http response errors and broadcast an event that my main controller can react to. (function () { 'use strict'; angular .module('app') …
PeteGO
  • 5,597
  • 3
  • 39
  • 70
0
votes
1 answer

Testing .on in directive expected spy got function

I am trying to test the reciever from a $broadcast (from a controller) in my directive via .on. Directive: describe('<-- myDirective Spec ------>', function () { var scope, $compile, element, $httpBackend, rootScope; …
Oam Psy
  • 8,555
  • 32
  • 93
  • 157
0
votes
0 answers

Communicate to a sibling controller who is not explicitly defined

Hello I have the following situation I have a controller with a Method, that sets a timeout and calls a modal along with other actions: angular .module('app') .controller('GlobalController', GlobalController); function…
DJ22T
  • 1,628
  • 3
  • 34
  • 66
0
votes
2 answers

Broadcast and on not working as desired

I am trying to broad cast from 1 controller and watch for that variable on another controller and expecting some changes on the second controller. But its not working. Below is the first controller code $scope.gotoKBPage = function() { …
Hacker
  • 7,798
  • 19
  • 84
  • 154
0
votes
1 answer

View Not updating- Angular

the view in the index file is not updating. here are the code snippits. index:
Shauzab
  • 65
  • 1
  • 4
  • 11
0
votes
0 answers

Parent controller does not trigger $broadcast event for child controller on refreshing page

In Parent controller I am getting timer value in seconds and displaying it on Index page whose controller is "ParentController". I have added one partial view using ui-view directive. Partial view's controller is "Child controller". In our case…
0
votes
1 answer

can't get rootscope working in controller

so im trying to broadcast a event from a controller to another. but i keep getting this error my controller look like this. angular.module('myApp',[]). controller('20SettingsController', ['$rootscope','$scope', '$http', '$modal', …
DaCh
  • 921
  • 1
  • 14
  • 48
0
votes
1 answer

angular broadcast not updating on second call

I have a controller which calls a service. Within the service, i perform a $rootScope.$broadcast which works perfectly on page load. However, when i call the service again, the $rootScope.$broadcast doesnt seem to be…
0
votes
3 answers

How to access updated value in different page controllers?

I have a problem with getting updated value between in different page controller, Here is the situation. page1.html
{{ version }}
page2.html
s1lam8u
  • 111
  • 1
  • 3
  • 13
0
votes
1 answer

AngularJS broadcasting

I have a refresh function that needs to be broadcast to child controllers. I made something like this in the parent controller: // Refresh/Cancel $scope.OnGridBODRefresh() = { function () { …
Aviator
  • 613
  • 4
  • 11
  • 26
0
votes
1 answer

AngularJS not updating view after $broadcast

I know I'm not the first who has this problem but no solution over here helped me to solve it. I've two controllers a ShowController and a CreateController. I want to broadcast from the ShowController and receive in the CreateCrontroller. To do so…
0
votes
1 answer

how to broadcast and emit events to other controllers in angular that have no parent-child relationship

I am trying to get hints from this post - Working with $scope.$emit and $scope.$on but nothing seems to work when the controllers are in no way related to each other. That is -
David
  • 4,235
  • 12
  • 44
  • 52
-1
votes
2 answers

what is main purpose of broadcast in angularJS?

I saw some examples for broadcast there I observed it is for send data from parent controller to child controller only, but by default child control hava access to the parent controller so what is specific purpose of it? please do not bring…
anilkumar
  • 11
  • 1
  • 3
-2
votes
2 answers

$broadcast working asynchronously, need to be synchronous

I have a controller which has a number of $rootScope.$broadcast which update the contents of a directive. The first $rootScope.$broadcast is clearing all the contents/data whilst the other populates it. app.controller('MyController',…
1 2
3