fix(common): return ISubscription from Location.subscribe() (#20429)

Fix #20406

PR Close #20429
This commit is contained in:
Jason Aden
2017-11-14 10:41:37 -08:00
committed by Miško Hevery
parent 135cf226bf
commit bc904b19a4
5 changed files with 8 additions and 5 deletions

View File

@ -13,7 +13,8 @@ const globals = {
'@angular/core': 'ng.core',
'@angular/common': 'ng.common',
'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx'
'rxjs/Subject': 'Rx',
'rxjs/Subscription': 'Rx'
};
module.exports = {

View File

@ -8,6 +8,7 @@
import {Location, LocationStrategy} from '@angular/common';
import {EventEmitter, Injectable} from '@angular/core';
import {ISubscription} from 'rxjs/Subscription';
/**
@ -107,7 +108,7 @@ export class SpyLocation implements Location {
subscribe(
onNext: (value: any) => void, onThrow?: ((error: any) => void)|null,
onReturn?: (() => void)|null): Object {
onReturn?: (() => void)|null): ISubscription {
return this._subject.subscribe({next: onNext, error: onThrow, complete: onReturn});
}