How to parse only single data from file in ionic 3 using HTTP


hello all ,
I have to display only single user data from Json file . I know to display multiple User data from json file we Use *ngFor =" let item of items " like this …But to display only single data I can’t use ngfor right ?? so How I can achieve this task in ION-HTML file??


Do you want to show single data with any condition? What will be the condition to get the single data ? clarify your requirement.

You can filter data with *ngFor or you can filter the data from component.


I have to Parse JSON output from “” and display on page

So my problem is if there is multiple user data instead of this single data to display I used ngFor right ? but here how can I display this data without using ngfor

my TS file code is this

import { Component } from ‘@angular/core’;
import { NavController } from ‘ionic-angular’;
import { HttpClient} from ‘@angular/common/http’;
import { Observable } from ‘rxjs/Observable’;
selector: ‘page-home’,
templateUrl: ‘home.html’
export class HomePage {
public items:any;
constructor(public navCtrl: NavController , public http: HttpClient) {

let data : any;
data = this.http.get(‘’);
data.subscribe(result => {

my HTML file code is this
and this is showing error to me co.items is undefined …so how can i solved this ?


I want output like this

data.subscribe(result => {

Do link this in component.ts as you are getting single object.


In component.ts or Home.ts where ?


where you request http data = this.http.get(‘’);


Thank you but , is there any changes I have to do in HTML file ?

because it showing me error co.items in undefined


No , don’t have to change anything in html


thanks but it giving me error on browser " co.items in undefined"


what type of error are you getting ?


co.items in undefined


btw you have to request data = this.http.get(‘’);


yes from this only

can you please check my code
home.ts file

my html file


why you are using *ngFor ? *ngFor only for Array of Objects. But you are getting only one object . So don’t need to use *ngFor. remove the line *ngFor="let item of items" form HTML


then it giving me error “co.item is undefined”



check the code carefully
replace items with item


Thanks but still there is error co.item is undefined


can you please try this task to parse the data from

or can i send my code to you ? on your id ?


upload your code on stackblitz