hiii... 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",
}
]
}
.....]
the parameter retrieved successfully by ,
*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}); }*all the data from
the json1 is available in result . But I didn't want to display all the
json data. If the parameter is " aa " , then display the "test1" and
"test2" data of "aa"... Is there any possible solution ..?
I tried but not work .
this.a= this.result.map(item=>item.Name['name']); // name is the parameter
received
and also try to display in table like
*<tr *ngFor = "let d of result['{{name}}']">
<td>{{name}}</td><td>{{d.test1}}</td><td>{{d.test2}}</td></tr>*please
help
*.....!*
--
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.