diff --git a/src/components/textField/demo1/index.html b/src/components/textField/demo1/index.html
index b3e2c5a48bc..3ce4d345320 100644
--- a/src/components/textField/demo1/index.html
+++ b/src/components/textField/demo1/index.html
@@ -9,15 +9,15 @@
-
diff --git a/src/components/textField/demo1/script.js b/src/components/textField/demo1/script.js
index be4a53bfc70..d90a940b24d 100644
--- a/src/components/textField/demo1/script.js
+++ b/src/components/textField/demo1/script.js
@@ -2,20 +2,30 @@
angular.module('formDemo1', ['ngMaterial'])
.controller('AppCtrl', function($scope) {
- $scope.data = {};
+ $scope.data = {
+ i1 : "Field #1",
+ i2 : "Field #2",
+ i3 : "Field #3",
+ i4 : "Field #4",
+ i5 : "Field #5",
+ i6 : "Field #6",
+ i7 : "Field #7",
+ i8 : "Field #8"
+ };
})
.directive('ig', function() {
return {
restrict: 'E',
replace: true,
- scope: {
- fid: '@'
+ scope : {
+ fid : '@',
+ title : '=value'
},
- template:
+ template:
'' +
'' +
- '' +
+ '' +
''
};
});
diff --git a/src/components/textField/textField.js b/src/components/textField/textField.js
index 7a0c85e5883..c2e132e9d7d 100644
--- a/src/components/textField/textField.js
+++ b/src/components/textField/textField.js
@@ -75,13 +75,13 @@ function materialInputDirective() {
// When the input value changes, check if it "has" a value, and
// set the appropriate class on the input group
if (ngModelCtrl) {
- ngModelCtrl.$viewChangeListeners.push(function() {
- inputGroupCtrl.setHasValue(!!ngModelCtrl.$viewValue);
+ //Add a $formatter so we don't use up the render function
+ ngModelCtrl.$formatters.push(function(value) {
+ inputGroupCtrl.setHasValue(!!value);
+ return value;
});
- ngModelCtrl.$render = function() {
- inputGroupCtrl.setHasValue(!!ngModelCtrl.$viewValue);
- };
}
+
element.on('input', function() {
inputGroupCtrl.setHasValue(!!element.val());
});