fix(input): recognize 'password' as an html input type

This commit is contained in:
Konstantin Stepanov 2011-10-18 02:18:27 +03:00 committed by Igor Minar
parent 8978e066b5
commit e82e64d57b
2 changed files with 9 additions and 1 deletions

View file

@ -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");
/**

View file

@ -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();