meteor-sweetalert icon indicating copy to clipboard operation
meteor-sweetalert copied to clipboard

Pass in variables to text attribute?

Open bwobst opened this issue 9 years ago • 0 comments

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.

bwobst avatar Nov 17 '15 20:11 bwobst