0

I want to display a image from url path in database, I store it in an attribute:

`

              <h2>
                {{pokemon.nomPokemon}}
              </h2>

              <table>
                  <tr >
                      <td> Id</td>
                      <td>Nom </td>
                      <td> type</td>
                    </tr>
                <tr >
                  <td> {{pokemon.idPokemon}}</td>
                  <td> {{pokemon.nomPokemon}}</td>
                  <td> {{pokemon.typePokemon}}</td>
                </tr>
              </table>


            </div>`

imgPokemon is a String and the other String attributes are displayed. My image is in "assets/img/pika.png" and if I put directly the path it works but not if I put the path in attribute.

Any advice? : )

1 Answer 1

1
<img ng-src="assets/img/pika.png" alt=""/>

or

<img ng-src="{{pokemon.imagePath}}"  alt=""/>
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for answering, but it doesn't hep me much when I use the second solution the path stored doesn't seem to work. I must say that I click on a button on my view and and a findById is executed and the path and others attributes are stored.
Nevermind I found my mistake, it was a typo in my Eclipse project. Have a good day!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.