If I create an observable utilizing the $createObservableFunction method and I subscribe to that observable multiple times. The last subscriber overrides any other subscriber.
However if I create an observable with rx.Observable.interval() and subscribe to that multiple times. Both subscribers fire on the interval.
Why? More importantly how do I get the $createObservableFunction to fire both subscribers.
app.controller('MainCtrl', function($scope, rx) {
var test = $scope.$createObservableFunction('testClick');
var test2 = rx.Observable.interval(3000);
test.subscribe(function(){
console.log('I never run, why?');
});
test.subscribe(function(){
console.log('Why am I overriding the above subscribe');
});
test2.subscribe(function(){
console.log('This observable runs both subscribed functions')
});
test2.subscribe(function(){
console.log('See this gets called and so does the above');
});
});
Example plunker that illustrates the issue. http://plnkr.co/edit/kXa2ol?p=preview