Q: How to get object sub values in angular 6 I am trying to get object sub values but not working.I do not know where I did mistake from my code.Anyone can find the solution?I am trying to show li values from object.
test.json:
"main":[{

"power":"coming",
"cell":"2min",
"li":[
 {
"text":"Lorem ipsom"
 },
 {
"text":"Ipsom klgtoy"
 },
 {
"text":"Klopi"
},
{
"text":"Mkhoi ipsom"
}
]
}];

app.component.html
<div *ngFor="val of main let i=index">

<ul>

<li>{{ val.li.text  }}</li>

</ul>

</div>


A: first of all i dont know what is tha test.json file 
you must write your js in .ts or .js file 
and the right way to declare array and object is :
 var main=[{
     power:"coming":,
     cell:"2min",
     li:[{
        text:"Lorem ipsom"
         },
         {
         text:"Ipsom klgtoy"
         },
         {
         text:"Klopi"
         },
         {
         text:"Mkhoi ipsom"
         }
      ]
}]

also you didn't close li arrays 
and for getting each text you must go through 2 loops first getting each object of main array and second one getting each object of li array

<div>

<ul *ngFor="val of main let i=index">

<li *ngFor="eachText of val.li let i=index">{{ eachText  }}</li>

</ul>

</div>

