Am using angular2. I have a nested Json like :
[
{
"Name": "aa",
"vallue": 11,
"type": [
{
"test1": "value1",
"test2": "value2",
}
]
},
{
"Name": "bb",
"vallue": 22,
"type": [
{
"test1": "value1",
"test2": "value2",
}
]
}
.....]
I have to access this Json data based on the Name. The name is retrieved successfully from the URL , like
this.route.params.subscribe( params => {
this.name= params['id'];
and in the constructor of my component get data from url
constructor(private http : Http ,private route: ActivatedRoute){
this.http.get('http://192.168.0.101:8000/json1')
.map(response => response.json())
.subscribe(data =>{ this.result = data});
}
I want to display the table which contains
<table border="1" cellspacing="10" cellpadding="10" width="500">
<tr><th>NAME</th><th>Type</th><th>prefix</th><th>rate</th></tr>
<tr *ngFor = "let d of result['{{name}}']">
<td>{{name}}</td><td>{{d.test1}}</td><td>{{d.test2}}</td></tr>
</table>
how can I display the specific details..Is there any possible solution .?? thanks in advance