mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
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:
committed by
Jeremy Elbourn
parent
bfee9c31eb
commit
cbecbced7d
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user