1

Example link is here https://stackblitz.com/edit/angular-rwwjo3?file=src/app/app.component.ts

I want to show a specific name for object 0 and object 1 of Items array. How can I achieve this. I am using NgJsonEditor.

This is HTML code -> HTML usage screenshot

This is the .ts -> .ts file usage screenshot

And the DATA is ->

export const DATA = { Items: [{ Name: "A", NumberProperty: 123, BooleanProperty: true, StringProperty: "abc", OrderBy: "DESC" }, { Name: "B", NumberProperty: 456, BooleanProperty: false, StringProperty: "def", OrderBy: "ASC" }] };

result screenshot

Thanks in advance.

  • Please, add a code sample on your question, sometimes links do not work, so code sample is best way to understand your problem and find out a solution. I tried twice but could not reach that web site. – Samet ÇELİKBIÇAK Dec 28 '21 at 06:14
  • Added a html and ts screenshot. Thank you @SametÇELİKBIÇAK – Josna Reddy Dec 28 '21 at 06:36
  • can someone please suggest an answer for the above question.. – Josna Reddy Dec 28 '21 at 10:24
  • When I check the package documentation it use data definition as below, ```this.data = {"products":[{"name":"car","product":[{"name":"honda","model":[{"id":"civic","name":"civic"},{"id":"accord","name":"accord"},{"id":"crv","name":"crv"},{"id":"pilot","name":"pilot"},{"id":"odyssey","name":"odyssey"}]}]}]} ``` but it your code we could not see your data structure. Could you try example data for your application. Also you can check this link: https://stackblitz.com/edit/angular-json-editor – Samet ÇELİKBIÇAK Dec 28 '21 at 10:42
  • I checked the example link what you have mentioned above, you can see the tree view of json editor, if you expand the products array it's showing the first object as " 0 {2} ", so here instead of "0 {2} " how can I show a specific name.?? @SametÇELİKBIÇAK – Josna Reddy Dec 28 '21 at 12:29
  • I guess there is no support for it, because of `0{2}` it belongs to array index and values information. I could not find any solution to help. – Samet ÇELİKBIÇAK Dec 28 '21 at 14:21

0 Answers0