Skip to content

Commit

Permalink
feat(router): Support unsubscription from Location by returning the s…
Browse files Browse the repository at this point in the history
…ubscription.
  • Loading branch information
alxhub committed Oct 26, 2015
1 parent 8dd3082 commit 2674eac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions modules/angular2/src/mock/location_mock.ts
Expand Up @@ -44,8 +44,8 @@ export class SpyLocation implements Location {
}

subscribe(onNext: (value: any) => void, onThrow: (error: any) => void = null,
onReturn: () => void = null) {
ObservableWrapper.subscribe(this._subject, onNext, onThrow, onReturn);
onReturn: () => void = null): Object {
return ObservableWrapper.subscribe(this._subject, onNext, onThrow, onReturn);
}

// TODO: remove these once Location is an interface, and can be implemented cleanly
Expand Down
4 changes: 2 additions & 2 deletions modules/angular2/src/router/location.ts
Expand Up @@ -144,8 +144,8 @@ export class Location {
* Subscribe to the platform's `popState` events.
*/
subscribe(onNext: (value: any) => void, onThrow: (exception: any) => void = null,
onReturn: () => void = null): void {
ObservableWrapper.subscribe(this._subject, onNext, onThrow, onReturn);
onReturn: () => void = null): Object {
return ObservableWrapper.subscribe(this._subject, onNext, onThrow, onReturn);
}
}

Expand Down

0 comments on commit 2674eac

Please sign in to comment.