Thanks for this! :) On Tuesday, January 15, 2013 1:04:35 PM UTC-7, Pete Bacon Darwin wrote: > > Actually that is not strictly true. In the docs - > http://docs.angularjs.org/api/ng.$rootScope.Scope#$on - you can see that > $on returns a "deregistration" function. So you can do things like: > > var removeListener = scope.$on('some-event', function handler(event) { ... > }); > ... > removeListener(); > > And voila! It is gone. > > > On 15 January 2013 18:26, Pawel Kozlowski <[email protected] > <javascript:>> wrote: > >> Hi! >> >> There is no method for un-registering those listeners. Those will be >> automatically destroyed when a corresponding scope is destroyed. >> Please note that those listener are AngularJS-specific communication >> bus and has nothing to do with DOM events and their listeners. >> >> Cheers, >> Pawel >> >> On Tue, Jan 15, 2013 at 5:46 PM, kostik.noir >> <[email protected] <javascript:>> wrote: >> > Hi. >> > I'm new in angular. >> > There is $on method of scope which allow to add event listeners. But >> I'm not >> > find way how to remove listener. Google was not help too. >> > Thanks. >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups >> > "AngularJS" group. >> > To post to this group, send email to [email protected] >> <javascript:>. >> > To unsubscribe from this group, send email to >> > [email protected] <javascript:>. >> > Visit this group at http://groups.google.com/group/angular?hl=en-US. >> > >> > >> >> >> >> -- >> Question? Send a fiddle >> (http://jsfiddle.net/pkozlowski_opensource/Q2NpJ/) or a plunk >> (http://plnkr.co/) >> Need help with jsFiddle? Check this: >> >> http://pkozlowskios.wordpress.com/2012/08/12/using-jsfiddle-with-angularjs/ >> >> Looking for UI widget library for AngularJS? Here you go: >> http://angular-ui.github.com/ >> >> -- >> You received this message because you are subscribed to the Google Groups >> "AngularJS" group. >> To post to this group, send email to [email protected] >> <javascript:>. >> To unsubscribe from this group, send email to >> [email protected] <javascript:>. >> Visit this group at http://groups.google.com/group/angular?hl=en-US. >> >> >> >
-- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
