Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
fix(input): recognize 'password' as an html input type
Browse files Browse the repository at this point in the history
  • Loading branch information
kstep authored and IgorMinar committed Oct 19, 2011
1 parent 8978e06 commit e82e64d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/widget/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");


/**
Expand Down
8 changes: 8 additions & 0 deletions test/widget/inputSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit e82e64d

Please sign in to comment.