Disable nested key support in angular formly for a single field? -
i've got model returned api (that not control), has keys have dots in it.
{ "permissions": { "account.read": true, "account.write": false } }
when go use in angular formly, automatically creating nested model due . in keys:
vm.fields = [ { key: 'permissions', fieldgroup: [ { key: 'account.read', type: 'input', templateoptions: { type: 'checkbox', label: 'can view accounts' } }, { key: 'account.write', type: 'input', templateoptions: { type: 'checkbox', label: 'can create accounts' } } ];
creates in model:
{ "permissions": { "account": { "read": true, "write": true } } }
is there way preserve non-nested keys? workaround i'm using right replace . _ , transform when it's submitted.
Comments
Post a Comment