Merge branch 'dev' of https://git.verdnatura.es/salix into dev
* 'dev' of https://git.verdnatura.es/salix: textfield canvia las cadenas vacias a null
This commit is contained in:
commit
8cad612a59
|
@ -25,6 +25,7 @@ export default class Textfield extends Component {
|
||||||
|
|
||||||
let div = this.element.firstChild;
|
let div = this.element.firstChild;
|
||||||
componentHandler.upgradeElement(div);
|
componentHandler.upgradeElement(div);
|
||||||
|
|
||||||
}
|
}
|
||||||
link($scope, $attrs) {
|
link($scope, $attrs) {
|
||||||
let mdlTextField = this.element.firstChild.MaterialTextfield;
|
let mdlTextField = this.element.firstChild.MaterialTextfield;
|
||||||
|
@ -32,9 +33,12 @@ export default class Textfield extends Component {
|
||||||
|
|
||||||
$scope.$watch($attrs.model,
|
$scope.$watch($attrs.model,
|
||||||
() => mdlTextField.updateClasses_());
|
() => mdlTextField.updateClasses_());
|
||||||
|
|
||||||
|
let $input = angular.element( this.input);
|
||||||
|
$input.controller('ng-model').$parsers.push(value => value === '' ? null : value);
|
||||||
}
|
}
|
||||||
onClearClick() {
|
onClearClick() {
|
||||||
this.input.value = '';
|
this.input.value = null;
|
||||||
this.checkValue();
|
this.checkValue();
|
||||||
|
|
||||||
let event = this.document.createEvent('HTMLEvents');
|
let event = this.document.createEvent('HTMLEvents');
|
||||||
|
|
Loading…
Reference in New Issue