diff options
Diffstat (limited to 'moon_gui/static/app/services/gui/form.service.js')
-rwxr-xr-x | moon_gui/static/app/services/gui/form.service.js | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/moon_gui/static/app/services/gui/form.service.js b/moon_gui/static/app/services/gui/form.service.js deleted file mode 100755 index e436593c..00000000 --- a/moon_gui/static/app/services/gui/form.service.js +++ /dev/null @@ -1,47 +0,0 @@ -/** - * @author arnaud marhin<arnaud.marhin@orange.com> - */ - -(function() { - - 'use strict'; - - angular - .module('moon') - .factory('formService', formService); - - function formService() { - - var service = {}; - - service.isInvalid = isInvalid; - service.checkFieldsValidity = checkFieldsValidity; - - return service; - - function isInvalid(form) { - return form.$invalid; - } - - function checkFieldsValidity(form) { - - var validationErrorKeys = _.keys(form.$error); - - _(validationErrorKeys).each(function(anErrorKey) { - - var formFields = _.values(form.$error[anErrorKey]); - - _(formFields).each(function(aFormField) { - - aFormField.$dirty = true; - aFormField.$setValidity(anErrorKey, false); - - }); - - }); - - } - - } - -})(); |