Add server error messages to all views with directive

Hi

I created a directive that shows server errors (40* or 50*). I implemented it as a http error interceptor wich sets a small box visible. I am using the tabs starter project and I have the following the index.html structure:

 <body ng-app="cashless" animation="slide-left-right-ios7">
    <!-- 
      The nav bar that will be updated as we navigate between views.
    -->
    <ion-nav-bar class="bar-stable nav-title-slide-ios7">
      <ion-nav-back-button class="button-icon icon ion-chevron-left">
      </ion-nav-back-button>
    </ion-nav-bar>
    <!-- 
      The views will be rendered in the <ion-nav-view> directive below
      Templates are in the /templates folder (but you could also
      have templates inline in this html file if you'd like).
    -->
    <ion-nav-view></ion-nav-view>
  </body>

My question, do I have to add the directive that displays the error message on every view? I tried to put it below the tag or below the in the index file but it does not show up.

Any other ideas?

BR, Rene

Hmm, do you mind putting some sample code? A codepen or plnkr. This way we could better help you out.

Have you see this? http://codepen.io/ionic/pen/pEter

It’s a great way to show an error from a HTTP call.

Hex Calendee

THX a lot. Looks perfect!

Do work on Android if into css there is top: 44px;?

It’s a beauty method to show error. But How to use with directive or decorator? There is angular-toast plugin: GitHub - jirikavi/AngularJS-Toaster: AngularJS Toaster is a customized version of "toastr" non-blocking notification javascript library.