0

I am using the toaster directive on my AngularJS web project.

Everything is configured as in the documentation; this is, on my view I have the container declared as follows.

<toaster-container toaster-options="{'time-out': 3000, 'close-button':true, 'animation-class': 'toast-top-right'}"></toaster-container>

I have injected the 'toaster' module globally on my app.js file and the 'toaster' service on my controller of interest. On some action occurence I am calling

toaster.pop('success', "Comentario Actualizado", "");

The toast shows up on the view, at the correct spot, with the cancel button and the timeout that I configured of course. However, the toast is not showing any text along with it. Anything I incorrectly implemented or anything I could be missing ? Please help, I know the problem is super trivial but I truly don't understand why the expected behavior is not happening.

Thanks

Pradeepb
  • 2,564
  • 3
  • 25
  • 46
Farid Hajnal
  • 253
  • 4
  • 15
  • It looks ok to me. check [here](https://jsfiddle.net/4orym7by/1/). – Pradeepb Mar 12 '17 at 22:08
  • Thanks, I see the fiddle works (why shouldn't it right?) However on the application I am working on it's not displaying the text , I suppose something else might be interfering... – Farid Hajnal Mar 13 '17 at 04:21
  • If that's the case put the related code – Pradeepb Mar 13 '17 at 06:08
  • Hello, the problem with my implementation is that I had the inside a div, which has ng-show property. So that, apparently, by doing this the toast becomes buggy. I moved the container to another part of the file and is now working properly. Thanks! – Farid Hajnal Mar 14 '17 at 19:43

1 Answers1

0

I faced the same problem with Angular. Turned out I hadn't imported BrowserAnimationsModule at the top, as mentioned on Getting Started With Default Configuration i.e.,

import {BrowserAnimationsModule} from '@angular/platform-browser/animations';

And then in the imports specifying:

imports: [BrowserAnimationsModule, ToasterModule.forRoot()]
ZerosAndOnes
  • 1,083
  • 1
  • 13
  • 25