user10837489
user10837489

Reputation:

How to give base url in angular when retrieve image from api

How to get api url when retrieve image from database

            <table class="table">
              <tr>
                <th>Id</th>
                <th>Image</th>

              </tr>
              <tr *ngFor="let image of images">

                <td>{{image.id}}</td>
                <td><img src="{{image.image}}"/></td>
              </tr>
            </table>        

Upvotes: 2

Views: 439

Answers (1)

Mujadid Mughal
Mujadid Mughal

Reputation: 2663

You can write like this

           <table class="table">
          <tr>
            <th>Id</th>
            <th>Image</th>

          </tr>
          <tr *ngFor="let image of images">

            <td>{{image.id}}</td>
            <td><img src="mypath/{{image.image}}"/></td>
          </tr>
        </table>

Thanks.

Upvotes: 1

Related Questions