@@ -23,7 +23,6 @@ import {
2323} from '../core' ;
2424import { ControlValueAccessor , NG_VALUE_ACCESSOR } from '@angular/forms' ;
2525import { Observable } from 'rxjs/Observable' ;
26- import { Subscription } from 'rxjs/Subscription' ;
2726
2827export const MD_SLIDE_TOGGLE_VALUE_ACCESSOR : any = {
2928 provide : NG_VALUE_ACCESSOR ,
@@ -77,9 +76,6 @@ export class MdSlideToggle implements OnDestroy, AfterContentInit, ControlValueA
7776 /** Reference to the focus state ripple. */
7877 private _focusRipple : RippleRef ;
7978
80- /** Subscription to focus-origin changes. */
81- private _focusOriginSubscription : Subscription ;
82-
8379 /** Name value will be applied to the input element if present */
8480 @Input ( ) name : string = null ;
8581
@@ -133,18 +129,13 @@ export class MdSlideToggle implements OnDestroy, AfterContentInit, ControlValueA
133129 ngAfterContentInit ( ) {
134130 this . _slideRenderer = new SlideToggleRenderer ( this . _elementRef ) ;
135131
136- this . _focusOriginSubscription = this . _focusOriginMonitor
132+ this . _focusOriginMonitor
137133 . monitor ( this . _inputElement . nativeElement , this . _renderer , false )
138134 . subscribe ( focusOrigin => this . _onInputFocusChange ( focusOrigin ) ) ;
139135 }
140136
141137 ngOnDestroy ( ) {
142- this . _focusOriginMonitor . unmonitor ( this . _inputElement . nativeElement ) ;
143-
144- if ( this . _focusOriginSubscription ) {
145- this . _focusOriginSubscription . unsubscribe ( ) ;
146- this . _focusOriginSubscription = null ;
147- }
138+ this . _focusOriginMonitor . stopMonitoring ( this . _inputElement . nativeElement ) ;
148139 }
149140
150141 /**
0 commit comments