mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix(): fixed failing test
This commit is contained in:
parent
61017fc204
commit
319b934967
@ -21,13 +21,13 @@ export class Emitter {
|
|||||||
this.subjects[fnName].next(data);
|
this.subjects[fnName].next(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
on(name, handler, $scope) {
|
on(name, handler, scope?) {
|
||||||
var fnName = createName(name);
|
var fnName = createName(name);
|
||||||
this.subjects[fnName] || (this.subjects[fnName] = new Subject());
|
this.subjects[fnName] || (this.subjects[fnName] = new Subject());
|
||||||
var subscription = this.subjects[fnName].subscribe(handler);
|
var subscription = this.subjects[fnName].subscribe(handler);
|
||||||
|
|
||||||
if ($scope) {
|
if (scope) {
|
||||||
$scope.$on('$destroy', function() {
|
scope.$on('$destroy', function() {
|
||||||
subscription.unsubscribe();
|
subscription.unsubscribe();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user