aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Stepanov2011-10-18 02:18:27 +0300
committerIgor Minar2011-10-19 10:36:36 -0700
commite82e64d57b65d9f3c4f2e8831f30b615a069b7f6 (patch)
tree8772f8d3eb39eddf8b1623d01f4072dc44b4bc80
parent8978e066b5f7fd0fac273b470b90fe4f9bef48c2 (diff)
downloadangular.js-e82e64d57b65d9f3c4f2e8831f30b615a069b7f6.tar.bz2
fix(input): recognize 'password' as an html input type
-rw-r--r--src/widget/input.js2
-rw-r--r--test/widget/inputSpec.js8
2 files changed, 9 insertions, 1 deletions
diff --git a/src/widget/input.js b/src/widget/input.js
index ec9701e7..e920733b 100644
--- a/src/widget/input.js
+++ b/src/widget/input.js
@@ -579,7 +579,7 @@ function numericRegexpInputType(regexp, error) {
var HTML5_INPUTS_TYPES = makeMap(
"search,tel,url,email,datetime,date,month,week,time,datetime-local,number,range,color," +
- "radio,checkbox,text,button,submit,reset,hidden");
+ "radio,checkbox,text,button,submit,reset,hidden,password");
/**
diff --git a/test/widget/inputSpec.js b/test/widget/inputSpec.js
index a4fc86aa..837d8c83 100644
--- a/test/widget/inputSpec.js
+++ b/test/widget/inputSpec.js
@@ -405,6 +405,14 @@ describe('widget: input', function() {
});
+ describe('password', function () {
+ it('should not change password type to text', function () {
+ compile('<input type="password" ng:model="name" >');
+ expect(element.attr('type')).toBe('password');
+ });
+ });
+
+
it('should ignore text widget which have no name', function() {
compile('<input type="text"/>');
expect(scope.$element.attr('ng-exception')).toBeFalsy();