Last active
August 5, 2017 04:34
-
-
Save angelomiranda/f2906d04b37afde252b27ac1711af21d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const formValue = form.value; // model values coming from ngForm model | |
const arrayOfObjects = Object.keys(formValue) | |
.reduce((result, current) => { | |
const value = formValue[current]; | |
if (_.includes(this.remoteLoggingOptions, current) && value) { | |
result.push({ | |
key: 'loggerRemoteLevels', | |
value: current | |
}); | |
} | |
if (current === 'waitTime') { | |
result.push({ | |
key: 'loggerRemoteWaitTime', | |
value: value | |
}); | |
} | |
if (current === 'maxMsgs') { | |
result.push({ | |
key: 'loggerRemoteMaxMsgs', | |
value: value | |
}); | |
} | |
return result; | |
}, []); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment