diff --git a/src/lib/checkbox/checkbox.html b/src/lib/checkbox/checkbox.html index 7676f48c69f8..c7815c48293e 100644 --- a/src/lib/checkbox/checkbox.html +++ b/src/lib/checkbox/checkbox.html @@ -1,6 +1,6 @@ diff --git a/src/lib/checkbox/checkbox.ts b/src/lib/checkbox/checkbox.ts index 9874e7697b47..e8d3124bdfa1 100644 --- a/src/lib/checkbox/checkbox.ts +++ b/src/lib/checkbox/checkbox.ts @@ -158,17 +158,12 @@ export class MdCheckbox extends _MdCheckboxMixinBase /** The native ` element */ @ViewChild('input') _inputElement: ElementRef; - @ViewChild('labelWrapper') _labelWrapper: ElementRef; - - /** Whether the checkbox has label */ - _hasLabel(): boolean { - const labelText = this._labelWrapper.nativeElement.textContent || ''; - return !!labelText.trim().length; - } - /** Called when the checkbox is blurred. Needed to properly implement ControlValueAccessor. */ @ViewChild(MdRipple) _ripple: MdRipple; + /** Whether the checkbox has a label set or not. */ + _hasLabel: boolean = false; + /** * Called when the checkbox is blurred. Needed to properly implement ControlValueAccessor. * @docs-private diff --git a/src/lib/checkbox/index.ts b/src/lib/checkbox/index.ts index 1987bac28630..cfcce8f5d697 100644 --- a/src/lib/checkbox/index.ts +++ b/src/lib/checkbox/index.ts @@ -1,11 +1,11 @@ import {NgModule} from '@angular/core'; import {CommonModule} from '@angular/common'; -import {MdRippleModule, MdCommonModule, FocusOriginMonitor} from '../core'; +import {MdRippleModule, MdCommonModule, FocusOriginMonitor, ObserveContentModule} from '../core'; import {MdCheckbox} from './checkbox'; @NgModule({ - imports: [CommonModule, MdRippleModule, MdCommonModule], + imports: [CommonModule, MdRippleModule, MdCommonModule, ObserveContentModule], exports: [MdCheckbox, MdCommonModule], declarations: [MdCheckbox], providers: [FocusOriginMonitor]