dist/@ajsf/core/esm2015/lib/shared/jsonpointer.functions.js
/**
     * 'toControlPointer' function
     *
     * Accepts a JSON Pointer for a data object and returns a JSON Pointer for the
     * matching control in an Angular FormGroup.
     *
     * //  { Pointer } dataPointer - JSON Pointer (string or array) to a data object
     * //  { FormGroup } formGroup - Angular FormGroup to get value from
     * //  { boolean = false } controlMustExist - Only return if control exists?
     * // { Pointer } - JSON Pointer (string) to the formGroup object
     */
'toControlPointer' function
Accepts a JSON Pointer for a data object and returns a JSON Pointer for the
matching control in an Angular FormGroup.

{ Pointer } dataPointer - JSON Pointer (string or array) to a data object
{ FormGroup } formGroup - Angular FormGroup to get value from
{ boolean = false } controlMustExist - Only return if control exists.
{ Pointer } - JSON Pointer (string) to the formGroup object
' toControlPointer ' function Accepts a JSON Pointer for a data object and returns a JSON Pointer for the matching control in an Angular FormGroup . { Pointer } dataPointer - JSON Pointer ( string or array ) to a data object { FormGroup } formGroup - Angular FormGroup to get value from { boolean = false } controlMustExist - Only return if control exists . { Pointer } - JSON Pointer ( string ) to the formGroup object
static toControlPointer(dataPointer, formGroup, controlMustExist = false) {
        const dataPointerArray = this.parse(dataPointer);
        const controlPointerArray = [];
        let subGroup = formGroup;
        if (dataPointerArray !== null) {
            for (const key of dataPointerArray) {
                if (hasOwn(subGroup, 'controls')) {
                    controlPointerArray.push('controls');
                    subGroup = subGroup.controls;
                }
                if (isArray(subGroup) && (key === '-')) {
                    controlPointerArray.push((subGroup.length - 1).toString());
                    subGroup = subGroup[subGroup.length - 1];
                }
                else if (hasOwn(subGroup, key)) {
                    controlPointerArray.push(key);
                    subGroup = subGroup[key];
                }
                else if (controlMustExist) {
                    console.error(`toControlPointer error: Unable to find "${key}" item in FormGroup.`);
                    console.error(dataPointer);
                    console.error(formGroup);
                    return;
                }
                else {
                    controlPointerArray.push(key);
                    subGroup = { controls: {} };
                }
            }
            return this.compile(controlPointerArray);
        }
        console.error(`toControlPointer error: Invalid JSON Pointer: ${dataPointer}`);
    }
static toControlPointer ( dataPointer , formGroup , controlMustExist = false ) { const dataPointerArray = this . parse ( dataPointer ) ; const controlPointerArray = [ ] ; let subGroup = formGroup ; if ( dataPointerArray !== null ) { for ( const key of dataPointerArray ) { if ( hasOwn ( subGroup , 'controls' ) ) { controlPointerArray . push ( 'controls' ) ; subGroup = subGroup . controls ; } if ( isArray ( subGroup ) && ( key === '-' ) ) { controlPointerArray . push ( ( subGroup . length - 1 ) . toString ( ) ) ; subGroup = subGroup [ subGroup . length - 1 ] ; } else if ( hasOwn ( subGroup , key ) ) { controlPointerArray . push ( key ) ; subGroup = subGroup [ key ] ; } else if ( controlMustExist ) { console . error ( ` ${ key } ` ) ; console . error ( dataPointer ) ; console . error ( formGroup ) ; return ; } else { controlPointerArray . push ( key ) ; subGroup = { controls : { } } ; } } return this . compile ( controlPointerArray ) ; } console . error ( ` ${ dataPointer } ` ) ; }
'toControlPointer' function
 Accepts a JSON Pointer for a data object and returns a JSON Pointer for the
 matching control in an Angular FormGroup.
' toControlPointer ' function Accepts a JSON Pointer for a data object and returns a JSON Pointer for the matching control in an Angular FormGroup .