mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-22 19:23:38 +08:00
fix(input): treat all not number model as blank
This commit is contained in:
@@ -449,6 +449,18 @@ describe('widget: input', function() {
|
||||
});
|
||||
});
|
||||
|
||||
describe('number', function(){
|
||||
it('should clear number on non-number', inject(function($compile, $rootScope){
|
||||
$rootScope.value = 123;
|
||||
var element = $compile('<input type="number" ng:model="value" >')($rootScope);
|
||||
$rootScope.$digest();
|
||||
expect(element.val()).toEqual('123');
|
||||
$rootScope.value = undefined;
|
||||
$rootScope.$digest();
|
||||
expect(element.val()).toEqual('');
|
||||
}));
|
||||
});
|
||||
|
||||
|
||||
it('should ignore text widget which have no name', function() {
|
||||
compile('<input type="text"/>');
|
||||
|
||||
Reference in New Issue
Block a user