A
A
Anna Gera2018-08-29 15:45:07
Angular
Anna Gera, 2018-08-29 15:45:07

How to output specific fields from an array of an object?

Good afternoon!
There is a json response from the server:
{"metaEntityConfigtime": {
"realmUuid": "578ba27c-21f1-4d38-b686-397d1b1b4ef5",
"metaEntityUuid": "66fa671b-56bd-47af-9d49-50c6e41f534f",
"metaEntityName": "SystemsDictionary" ",
"metaEntityDescription": "System Directory Type",
"metaEntityFields": [
{
"metaEntityFieldId": {
"metaEntityFieldUuid": "348e1e56-b14b-49ef-af4b-143658933340",
"metaEntityUuid": "66fa671b-56bd-47af- 9d49-50c6e41f534f"
},
"
"fieldType": "String",
"useInEntityReference": false
} and so on...
I need to display data from the metaEntityFields array.
How should it be in code???
Output name and uid already:

public loadMetaEntity(uuid: string) {
this.meUuid = uuid;
console log('get');
const srv = this.apiService.getMetaEntity(uuid);
console log('subscribe');
const req = srv.subscribe(
(response) => {
this.mecResp = response;
this._meName = this.mecResp.metaEntityConfigtime.metaEntityName;
console.log(this.mecResp);
Thanks to everyone who responded!!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Q
Qairat, 2018-09-13
@Qairat

newObj = [];
this.newObj = this.mecResp.metaEntityConfigtime.metaEntityFields;

And then use this.newObj:
this.newObj.metaEntityFieldId;
this.newObj.metaEntityFieldName;
this.newObj.metaEntityFieldDescription
;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question