Hi Sander,

Thanks for the quick reply. I've made a jsFiddle with the similar concept 
except in this instance I have a buttons to unsubscribe for each component 
rather than on destroy.....for simplicity. Here it 
is: https://jsfiddle.net/bkarv/499jhs9y/

I've tried disposing the subject but I get an error. I'm assuming I 
shouldn't be disposing the subject but the subscription itself hence the 
error. Do you mind having a look at it? Thanks heaps.



On Tuesday, 22 March 2016 14:17:46 UTC+11, Sander Elias wrote:
>
> Hi Ka,
>
> You need to unsubscribe on destroy. When you are no longer interested in 
> an subscription, you call it's unsubscribe function. How that is done is a 
> bit dependent on the RX version you are using.
> In RX 4 it is done something like this:
>
> var subscription = companySrchSubject.subscribe(subscription)
> $scope.$on('$destoy`, () => subscription.dispose())
>
>
> Regards
> Sander
>
>

-- 
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 https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to