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:
Carlos 2017-09-08 09:53:56 +02:00
commit 8cad612a59
1 changed files with 5 additions and 1 deletions

View File

@ -25,6 +25,7 @@ export default class Textfield extends Component {
let div = this.element.firstChild;
componentHandler.upgradeElement(div);
}
link($scope, $attrs) {
let mdlTextField = this.element.firstChild.MaterialTextfield;
@ -32,9 +33,12 @@ export default class Textfield extends Component {
$scope.$watch($attrs.model,
() => mdlTextField.updateClasses_());
let $input = angular.element( this.input);
$input.controller('ng-model').$parsers.push(value => value === '' ? null : value);
}
onClearClick() {
this.input.value = '';
this.input.value = null;
this.checkValue();
let event = this.document.createEvent('HTMLEvents');