Ionic 3 ngFor


#1

having a problem binding the json data to my page it shows up on my console log but binding it to the page comes up empty.


#2

in your home.html
put in your *ngFor loop

<h1 padding center> {{product.slug}} </h1>

#3

Change this.products = JSON.parse(data.body).products; to this.products = JSON.parse(data.body);


#4

still getting a blank


#5

i can see the json data on my console log so that really isnt a problem, its getting to show up on my view page


#6

after above changes what is output of
console.log(this.product) in console ?


#7

and other thing you must have to use {{}} wherever you want to use model data

i suggest use to write {{}} in img and p tag of your code


#8

#9

have you write {{}} in your html page ?


#10

yes i have it still doenst work


#11

can you show me your html and .cs code after all above changes ?


#12

fixed my little problem in case anyone runs into this problem just use this
console.log(JSON.parse(data.body));
this.products = (JSON.parse(data.body));
}, (err) => {
console.log(err)
})