How to use bootstrap alert in meteor?


#1

Hello everybody,

I just like to have a nice alert from bootstrap after deleting a user, here is my code :

"click #okDeleteUser": function (){
	Meteor.call("removeUser", {_id:Session.get('slelectedUser')});
	$("#UserRemoveModal").modal("hide");
	$().alert("User deleted");
},

But nothing is showing. I saw there is packages for alerts, but I’m not sure that it is the nice way to do it.
Any of you has advice or solution ?

Thanks in advance


#2

I am not sure about exact package to fire bootstrap alert, but as client side code is async, it will be executed at same time.
So think if you need to do it right after, or if you want to move it to Meteor.call callback, where you can show different modals based on the results if the action was successful or not…


#3

We use the bootbox.js port for modals, keeps everything simple, and solved a few problems with data context not getting passed.

For alerts we use the Bert Alerts package by @themeteorchef, really simple package for creating unobtrusive notifications to the user which would be great in the case you described!