Frankie K.
Frankie K.

Reputation: 77

When using a header logo in Ionic, the browser tab shows html

I have a logo image in my header using Ionic.

<ion-view title="<img class='title-image-pic' src='./img/MyImg.jpg'>">

It looks great, but the browser tab shows the html element. How do I work around this and have the browser tab display my title instead of:

<img class='title-image-pic' src='./img/MyImg.jpg'>

Thank you for any advice you can give.

Upvotes: 0

Views: 298

Answers (1)

Davide Pastore
Davide Pastore

Reputation: 8738

You can set your title in index.html:

<html>
  <head>
    <title>My App</title>
    <!-- Other things -->
  </head>
  <!-- Body and stuff -->
</html>

Then you can set the image in your own template, using the ion-nav-title directive:

<ion-nav-view>
  <ion-view>
    <ion-nav-title>
      <img class='title-image-pic' src='./img/MyImg.jpg'>
    </ion-nav-title>
    <ion-content>
      Some super content here!
    </ion-content>
  </ion-view>
</ion-nav-view>

Upvotes: 0

Related Questions