Mathijs den Burger pushed to branch feature/visual-editing-psp1-CHANNELMGR-898 at cms-community / hippo-addon-channel-manager
Commits: 12451b77 by Mathijs den Burger at 2016-12-09T10:46:33+01:00 CHANNELMGR-898 Refactoring - replace for loop with forEach (easier to read) - replace angular.extend with Object.assign (future-proof) - - - - - 1 changed file: - frontend-ng/src/angularjs/channel/sidePanels/rightSidePanel/fields.component.js Changes: ===================================== frontend-ng/src/angularjs/channel/sidePanels/rightSidePanel/fields.component.js ===================================== --- a/frontend-ng/src/angularjs/channel/sidePanels/rightSidePanel/fields.component.js +++ b/frontend-ng/src/angularjs/channel/sidePanels/rightSidePanel/fields.component.js @@ -45,13 +45,13 @@ class ChannelFieldsCtrl { _getMultipleFieldError(fieldType, fieldValues) { let combinedError = null; - for (let i = 0, len = fieldValues.length; i < len; i += 1) { - const fieldName = this.getFieldName(fieldType, i); + fieldValues.forEach((value, index) => { + const fieldName = this.getFieldName(fieldType, index); const field = this.form[fieldName]; if (field) { - combinedError = angular.extend(combinedError || {}, field.$error); + combinedError = Object.assign(combinedError || {}, field.$error); } - } + }); return combinedError; } View it on GitLab: https://code.onehippo.org/cms-community/hippo-addon-channel-manager/commit/12451b77e844f65d9c7b5619d41bb54ce8ca1c17
_______________________________________________ Hippocms-svn mailing list Hippocms-svn@lists.onehippo.org https://lists.onehippo.org/mailman/listinfo/hippocms-svn