Please I have problem when i print data in details page My code I Dont Want Use Services
**Schools Page**
items: Observable<any>;
constructor(private router: Router, private http: HttpClient) {}
ngOnInit() {
this.items = this.http.get('assets/data/schools.json');
this.items.subscribe(data => {
});
}
onselect(item){
this.router.navigate(['/education/schools', item.id])
}
<ion-content>
<ion-list >
<ion-item button detail lines="inset" *ngFor="let item of (items | async)?.schools"
(click)="onselect(item)" >
{{ item.name }}
</ion-item>
</ion-list>
</ion-content>
**Details Page**
public itemId;
constructor(private route: ActivatedRoute, private router : Router) {}
ngOnInit(){
this.route.paramMap.subscribe((params: ParamMap) =>{
let id = parseInt(params.get('id'));
this.itemId = id;
});
}
<ion-card >
<ion-card-content>
My Name {{item.name}}
</ion-card-content>
</ion-card>
i want to show {{item.name}} and others
1 post - 1 participant