From 319b9349672e1e1353f0c8350800f7a79bd49641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 25 Mar 2016 15:52:28 +0100 Subject: [PATCH] fix(): fixed failing test --- public/app/core/utils/emitter.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/app/core/utils/emitter.ts b/public/app/core/utils/emitter.ts index 045182c76d1..5de9dc78cfa 100644 --- a/public/app/core/utils/emitter.ts +++ b/public/app/core/utils/emitter.ts @@ -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(); }); }