fix(slide-toggle): remove view encapsulation (#1446)

* fix(slide-toggle): remove view encapsulation

* Removes the ViewEncapsulation from the slide-toggle component to allow developer overwriting the styles easly.

Fixes #1343.

* Make _hasFocus variable public again for AOT compiler
This commit is contained in:
Paul Gschwendtner
2016-10-18 20:20:36 +02:00
committed by Jeremy Elbourn
parent bfee9c31eb
commit cbecbced7d
2 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ $md-slide-toggle-margin: 16px !default;
@include md-temporary-ink-ripple(slide-toggle, true);
}
:host {
md-slide-toggle {
display: flex;
height: $md-slide-toggle-height;
+5 -1
View File
@@ -10,6 +10,7 @@ import {
AfterContentInit,
NgModule,
ModuleWithProviders,
ViewEncapsulation,
} from '@angular/core';
import {HAMMER_GESTURE_CONFIG} from '@angular/platform-browser';
import {
@@ -50,6 +51,7 @@ let nextId = 0;
templateUrl: 'slide-toggle.html',
styleUrls: ['slide-toggle.css'],
providers: [MD_SLIDE_TOGGLE_VALUE_ACCESSOR],
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class MdSlideToggle implements AfterContentInit, ControlValueAccessor {
@@ -61,10 +63,12 @@ export class MdSlideToggle implements AfterContentInit, ControlValueAccessor {
private _uniqueId = `md-slide-toggle-${++nextId}`;
private _checked: boolean = false;
private _color: string;
_hasFocus: boolean = false;
private _isMousedown: boolean = false;
private _slideRenderer: SlideToggleRenderer = null;
// Needs to be public to support AOT compilation (as host binding).
_hasFocus: boolean = false;
@Input() @BooleanFieldValue() disabled: boolean = false;
@Input() @BooleanFieldValue() required: boolean = false;
@Input() name: string = null;