瀏覽代碼

fix(): fixed failing test

Torkel Ödegaard 9 年之前
父節點
當前提交
319b934967
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      public/app/core/utils/emitter.ts

+ 3 - 3
public/app/core/utils/emitter.ts

@@ -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) {
-      $scope.$on('$destroy', function() {
+    if (scope) {
+      scope.$on('$destroy', function() {
         subscription.unsubscribe();
         subscription.unsubscribe();
       });
       });
     }
     }