Versions is an array, [],content elements also array, index it, beginning with 0,1.., you can play around on w3 schools json tutorial, try it, for practice, and then correct your accessing
On Wed, 24 Jun 2020 at 12:43 PM, [email protected] < [email protected]> wrote: > Thanks Manjari for your response. But it is not clear to me. > in html I am saving json in result object like this in my TS file. > this.result = JSON.parse(JSON.stringify(data)); > In html I am trying to access > <div> {{result.document.title}} </div> This works fine > <div> {{result.versions.attribute.versionnumber}} </div> *I dont get > this value* . Please look intot he structure of json > > Please share me what I am supposed to use to get correct reult. It is > something related to traversing to the json object which I am not sure how > to do it. > > Regards > SandeepS hukla > On Tuesday, June 23, 2020 at 5:59:20 PM UTC+2 [email protected] wrote: > >> You have to index from versions , as per your current Json >> Attributes , does not include cont... >> >> On Tue, 23 Jun 2020 at 8:39 PM, Sandeep Shukla <[email protected]> >> wrote: >> >>> Hi, >>> My json is >>> { >>> "error": null, >>> "document": { >>> "title": "Hello World Angular", >>> "heading": "subject to changes" >>> }, >>> "versions": [ >>> { >>> "attributes": { >>> "sequence": "1", >>> "versionNumber": "1.6", >>> "id": "A00100" >>> }, >>> "contentElements": [ >>> { >>> "contentType": "BASE", >>> "mediaType": "text/xml", >>> "fileName": null, >>> "size": 779, >>> "content": "This is content" >>> }, >>> { >>> "contentType": "NOTELOG", >>> "mediaType": "text/plain", >>> "fileName": null, >>> "size": 29, >>> "content": "Content2" >>> } >>> ] >>> } >>> ] >>> } How do i get the values in html under attributes,contentElements. I am >>> unable to get it. Any help would be appreciated. I can handle simple json >>> but this is something not working for me. Regards Sandeep Shukla >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Angular and AngularJS discussion" group. >>> >> To unsubscribe from this group and stop receiving emails from it, send an >>> email to [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/angular/279d78ce-1cc3-45fe-a9cc-ea57eedacc9fo%40googlegroups.com >>> <https://groups.google.com/d/msgid/angular/279d78ce-1cc3-45fe-a9cc-ea57eedacc9fo%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- >> Sent from Gmail Mobile >> > -- > You received this message because you are subscribed to the Google Groups > "Angular and AngularJS discussion" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/angular/2e27d9f8-1c33-475a-a2f3-5e88192ef7f0n%40googlegroups.com > <https://groups.google.com/d/msgid/angular/2e27d9f8-1c33-475a-a2f3-5e88192ef7f0n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Sent from Gmail Mobile -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/angular/CAMF%2BC3pFQr8sUM716O1qEEfoAkKZzguvV6iAaZc5t_nyzhyyRw%40mail.gmail.com.
