diff --git a/src/components/input/demoBasicUsage/index.html b/src/components/input/demoBasicUsage/index.html index 1852f5c4b44..3f45effd967 100644 --- a/src/components/input/demoBasicUsage/index.html +++ b/src/components/input/demoBasicUsage/index.html @@ -53,7 +53,7 @@ - + diff --git a/src/components/input/input.js b/src/components/input/input.js index 67fb80b9e75..2f4b158cda1 100644 --- a/src/components/input/input.js +++ b/src/components/input/input.js @@ -27,8 +27,10 @@ angular.module('material.components.input', [ * Input and textarea elements will not behave properly unless the md-input-container * parent is provided. * - * @param md-is-error {expression=} When the given expression evaluates to true, the input container will go into error state. Defaults to erroring if the input has been touched and is invalid. - * @param md-no-float {boolean=} When present, placeholders will not be converted to floating labels + * @param md-is-error {expression=} When the given expression evaluates to true, the input container + * will go into error state. Defaults to erroring if the input has been touched and is invalid. + * @param md-no-float {boolean=} When present, placeholders will not be converted to floating + * labels. * * @usage * @@ -55,6 +57,7 @@ function mdInputContainerDirective($mdTheming, $parse) { function postLink(scope, element, attr) { $mdTheming(element); } + function ContainerCtrl($scope, $element, $attrs) { var self = this; @@ -73,6 +76,9 @@ function mdInputContainerDirective($mdTheming, $parse) { self.setHasMessages = function(hasMessages) { $element.toggleClass('md-input-has-messages', !!hasMessages); }; + self.setHasPlaceholder = function(hasPlaceholder) { + $element.toggleClass('md-input-has-placeholder', !!hasPlaceholder); + }; self.setInvalid = function(isInvalid) { $element.toggleClass('md-input-invalid', !!isInvalid); }; @@ -110,10 +116,15 @@ function labelDirective() { * @description * Use the `` or the `