Commit 319b9349 by Torkel Ödegaard

fix(): fixed failing test

parent 61017fc2
......@@ -21,13 +21,13 @@ export class Emitter {
this.subjects[fnName].next(data);
}
on(name, handler, $scope) {
on(name, handler, scope?) {
var fnName = createName(name);
this.subjects[fnName] || (this.subjects[fnName] = new Subject());
var subscription = this.subjects[fnName].subscribe(handler);
if ($scope) {
$scope.$on('$destroy', function() {
if (scope) {
scope.$on('$destroy', function() {
subscription.unsubscribe();
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment