The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
0answers
12 views

Adding an onchange handler dynamically with Angular

I'm using Angular 1.6.1 with ASP.Net. I have a select in a partial which I use in several pages. On one of the pages, I want to handle the change, but I don't want to add the ng-change directive in ...
0
votes
2answers
18 views

how i can run function in 2 separated controllers in angularjs

i have 2 separate angularjs controller that named HomeController And SearchController i have a function that named "Search()" in HomeController how can i run search function from searchController ?
2
votes
1answer
45 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
1answer
40 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('...
0
votes
0answers
162 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
1answer
38 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
0answers
37 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 ...
0
votes
2answers
225 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
2answers
181 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
1answer
361 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
0answers
34 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? ...