alexcrack / angular-ui-notification

Angular.js service providing simple notifications using Bootstrap 3 styles with css transitions for animating
MIT License
536 stars 169 forks source link

Option to show "Close" button #27

Closed trsrm closed 9 years ago

trsrm commented 9 years ago

Please, implement option to show "Close" button. Thanks.

alexcrack commented 9 years ago

The message can be closed by clicking on any point inside it

alexcrack commented 9 years ago

Also you can use replaceMessage option to show only one new message in a time or if you need to close specific message programmatically see #16

celsomtrindade commented 8 years ago

Even though we can close by clicking on it, having a close button has it's pros.

We can show the user a more intuitive way to close the notification. Or even disable 'close' function when clicking anywhere and only close when clicking on a 'X' button.

I think it could improve usability.

vlad-lubenskyi commented 8 years ago

I also think the feature would be very useful. For example, I need to let the user select and copy text from the pop-up. For this, I want to have control over pop-up closing, that is the case for such button and possibly an API call.

mandadimuralidharreddy commented 7 years ago

Any way it is closing on click so.I did like below. Showing one close icon with out any functionality. Notification.error({message:' error',title:'Info <i class="glyphicon glyphicon-remove-circle pull-right" style="cursor: pointer;font-size: large;margin-top: -5px" ></i>',delay: 10000});

aplocher commented 7 years ago

A close button indicates an action which is just friendlier for UX in general. Even if you have to zero-in on a little button instead of the whole popup, there's no confusion. I don't think it should replace the current model, but be a secondary option. Also, I would like to be able to have them easily copy the text if needed (which might be a good place for a 1-click copy button) since the error notif may show stack trace info and that requires some clicking around.

wirdman commented 6 years ago

Hi guys,

just ran into the same issue (needing a close button). To achieve this you just have to add your custom template and inside that html add your button like this: <button type="button" class="close" ng-click="kill(true);">×\<\/button>

the kill is referenced in the documentation as a way to remove a notification. Hope this helps someone, Cheers.