Selected item from array with objects



I’m very new in ionic 2

**I’m tryin’ to console.log the selected pizza ** i have tried like this
itemSelected(pizzas) {
console.log(“Selected Item”, this.pizzas);

but it returns two objects

<ion-list *ngFor=“let pizza of pizzas” (click)=“itemSelected(pizzas)”>


        <img [src]="pizza.image" class="pizza-image" />
        <div class="pizza_info">
            <p> {{pizza.ingredients}} </p>
            <p> {{ pizza.prize + pizza.currency }}</p>
pizzas = [

  image: "",
  name: 'Pepperoni',
  ingredients: ["Parmesan cheese", "Extra sos", "Pepperoni"],
  prize: '5',
  currency: '€',
  image: "",
  name: 'Pershute',
  ingredients: ["Extra sos", "Pershute"],
  prize: '3',
  currency: '€',


If you only want to log 1 pizza, do this:

itemSelected(pizza) {
console.log("Selected Item", pizza);

this.pizzas refers to the local pizza’s array you’ve created in your Class (pizzas = [] etc…). So if you’re doing

 itemSelected(pizza) {
    console.log("Selected item", this.pizzas);

it will only log the value of this.pizzas and not the pizza you’re trying to catch in your click handler.


Thank you a billion times, i solved my problem.