diff --git a/src/components/input/README.md b/src/components/input/README.md index 6e3ab7ac4616..49d0d390bbbf 100644 --- a/src/components/input/README.md +++ b/src/components/input/README.md @@ -15,6 +15,18 @@ At the time of writing this README, the `[type]` attribute is copied to the actu The valid `type` attribute values are any supported by your browser, with the exception of `file`, `checkbox` and `radio`. File inputs aren't supported for now, while check boxes and radio buttons have their own components. +## Text Divider + +You can choose to show or hide the text divider line under the ``. By default the text divider will always be `true`. + +To hide the text divider: + +#### Example + +```html + + +``` ## Prefix and Suffix diff --git a/src/components/input/input.html b/src/components/input/input.html index f177fd3870a5..875020a5a5af 100644 --- a/src/components/input/input.html +++ b/src/components/input/input.html @@ -40,7 +40,7 @@
-
{ + return builder.createAsync(MdInputNoTextDividerTestController) + .then(fixture => { + fixture.detectChanges(); + expect(fixture.debugElement.query(By.css('.md-input-underline'))).toBeFalsy(); + }); + }); }); } @@ -387,3 +395,15 @@ class MdInputAriaTestController { ariaLabel: string = 'label'; ariaDisabled: boolean = true; } + +@Component({ + selector: 'text-input-controller', + template: ` + + + `, + directives: [MdInput] +}) +class MdInputNoTextDividerTestController { +} + diff --git a/src/components/input/input.ts b/src/components/input/input.ts index c90d27ae0a4c..3f706e444372 100644 --- a/src/components/input/input.ts +++ b/src/components/input/input.ts @@ -139,6 +139,7 @@ export class MdInput implements ControlValueAccessor, AfterContentInit, OnChange @Input() @BooleanFieldValue() required: boolean = false; @Input() @BooleanFieldValue() spellcheck: boolean = false; @Input() type: string = 'text'; + @Input() @BooleanFieldValue() textDivider: boolean = true; get value(): any { return this._value; }; @Input() set value(v: any) { diff --git a/src/demo-app/input/input-demo.html b/src/demo-app/input/input-demo.html index 6acaf024faaa..613f855d6491 100644 --- a/src/demo-app/input/input-demo.html +++ b/src/demo-app/input/input-demo.html @@ -26,6 +26,16 @@ + + Text Divider + + + + + + + + Prefix + Suffix