portainer/app/helpers/formHelper.js

19 lines
378 B
JavaScript
Raw Normal View History

angular.module('portainer.helpers')
.factory('FormHelper', [function FormHelperFactory() {
'use strict';
var helper = {};
helper.removeInvalidEnvVars = function(env) {
for (var i = env.length - 1; i >= 0; i--) {
var envvar = env[i];
if (!envvar.value || !envvar.name) {
env.splice(i, 1);
}
}
return env;
};
return helper;
}]);