This file contains hidden or 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
import { | |
FormGroup, | |
FormRecord, | |
FormArray, | |
ValidationErrors | |
} from '@angular/forms'; | |
export function getFormValidationErrors(form: FormGroup|FormRecord|FormArray, path ?: string = '$') { | |
const result = []; |
This file contains hidden or 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
/** | |
* Parses mixed type values into booleans. This is the same function as filter_var in PHP using boolean validation | |
* @param {Mixed} value | |
* @param {Boolean} nullOnFailure = false | |
* @return {Boolean|Null} | |
*/ | |
var parseBooleanStyle = function(value, nullOnFailure = false){ | |
if (typeof value !== 'string') | |
return Boolean(value); | |