Push an Image


#1

So I was wondering if it was possible to push an image from the url in typescript. When I click a button it should just display info to an html.

I have this so far:
defaultGames(){ let prompt = this.alertCtrl.create({ title: 'Create Defaults', buttons: [ { text: 'Yes', handler: data => { this.games.push({ 'image': URL(/path/to/image/) <------Not sure what to do 'title': 'Lock', 'description': 'A combination lock.', 'cost': 10.00 }); } }, { text: 'No', handler: data => { console.log('Defaults Cancelled'); } } ] }); prompt.present(); }

In my HTML

<ion-header>
  <ion-navbar>
    <ion-title>
      Games
    </ion-title>
    <ion-buttons end>
     <button ion-button icon-only (click)="addGame()">
       <ion-icon name="add-circle"></ion-icon>
     </button>
     <button ion-button icon-only (click)="defaultGames()">
       <ion-icon name="heart"></ion-icon>
     </button>
     <button ion-button icon-only (click)="trashGames()">
       <ion-icon name="trash"></ion-icon>
     </button>
     <button ion-button icon-only (click)="logOut()">
       <ion-icon name="log-out"></ion-icon>
     </button>
    </ion-buttons>
  </ion-navbar>
</ion-header>

<ion-content>
  <ion-grid style="color:white">

       <ion-item *ngFor="let item of games | async"
            >
       <ion-row style="color:white">
          **<ion-col>{{item.image}}</ion-col>**
          <ion-col>{{item.title}}</ion-col>
          <ion-col>{{item.description}}</ion-col>
          <ion-col>{{item.cost}}</ion-col>
           <ion-col>
           <button ion-button icon-only
           (click)="updateGame(item.$key, item.title, item )">

           Edit
           </button>
           </ion-col>
           <ion-col>
           <button ion-button icon-only (click)="removeGame(item.$key)">
           <ion-icon name="trash"></ion-icon>
           </button>
           </ion-col>
       </ion-row>
       </ion-item>
     </ion-grid>

</ion-content>

#2
this.games.push({image: "http://host/path/image.png"});

<ion-item *ngFor="let game of games | async">
  <img [src]="game.image">
</ion-item>

#3

Ok. This works. Thank you