private updateContextArgs()

in lib/template/app-context.ts [123:150]


    private updateContextArgs(appConfig: any, contextArgs: string[]) {
        for (let key of contextArgs) {
            const jsonKeys = key.split('.');
            let oldValue = '';
            const newValue: string = this.cdkApp.node.tryGetContext(key);

            if (newValue != undefined) {
                if (jsonKeys.length == 1) {
                    oldValue = appConfig[jsonKeys[0]];
                    appConfig[jsonKeys[0]] = newValue;
                } else if (jsonKeys.length == 2) {
                    oldValue = appConfig[jsonKeys[0]][jsonKeys[1]]
                    appConfig[jsonKeys[0]][jsonKeys[1]] = newValue;
                } else if (jsonKeys.length == 3) {
                    oldValue = appConfig[jsonKeys[0]][jsonKeys[1]][jsonKeys[2]];
                    appConfig[jsonKeys[0]][jsonKeys[1]][jsonKeys[2]] = newValue;
                } else if (jsonKeys.length == 4) {
                    oldValue = appConfig[jsonKeys[0]][jsonKeys[1]][jsonKeys[2]][jsonKeys[3]];
                    appConfig[jsonKeys[0]][jsonKeys[1]][jsonKeys[2]][jsonKeys[3]] = newValue;
                } else if (jsonKeys.length == 5) {
                    oldValue = appConfig[jsonKeys[0]][jsonKeys[1]][jsonKeys[2]][jsonKeys[3]][jsonKeys[4]];
                    appConfig[jsonKeys[0]][jsonKeys[1]][jsonKeys[2]][jsonKeys[3]][jsonKeys[4]] = newValue;
                }

                console.info(`updateContextArgs: ${key} = ${oldValue}-->${newValue}`);
            }
        }
    }