meteor-sweetalert
meteor-sweetalert copied to clipboard
Pass in variables to text attribute?
I tried adding the variable inline and by creating a variable before adding it to the swal
object. Any way to do this?
var sponsor = tmpl.find('#sponsorName').value;
var dynamicText = "Are you sure you want to delete" + sponsor + "?";
swal({
title: "Remove sponsor",
text: dynamicText,
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, delete it!",
closeOnConfirm: false,
html: true
}, function() {
swal("Deleted!",
"Deleted.",
"success");
});
Doing this just leaves a blank space where the variable should display.