moff / angular2-flash-messages

Angular 2 flash messages module
52 stars 21 forks source link

Close button/action added #25

Closed akempes closed 6 years ago

akempes commented 7 years ago

Hi,

I've added a (optional) close button as mentiond in #13. There is also an option to close the flash message by clicking on it. Both are configurable options and are false by default.

You can use it like this:

// Close by clicking anywhere on the message
this._flashMessagesService.show('we were at home', { cssClass: 'alert-success', timeout: 3000, closeOnClick:true });

// Close by clicking on the close button
this._flashMessagesService.show('we were at home', { cssClass: 'alert-success', timeout: 3000, showCloseBtn:true });
jusfeel commented 6 years ago

Is this being pulled?

moff commented 6 years ago

@akempes thank you for your contribution!

rpuls commented 6 years ago

Sorry, how is this enabled? i added the showCloseBtn:true but nothing changes. this.flashMessage.show('You are now logged in!', {cssClass: 'alert-success', timeout: 5000, showCloseBtn:true});

using: "angular2-flash-messages": "^2.0.4",

EDIT: SORRY! never mind! had to clean cache, and then it worked.... Thanks!