1

Sweet alert with html option is not working can you guys explain me to solve this.or otherwise i want to bind template explicitly to sweet alert.

    swal({
        title: "Are you sure?",
        text: '<b>Hiiii</b>' ,
        type: "info",
        showCancelButton: true,
        confirmButtonColor: "#F44336",
        confirmButtonText: "Yes, accept it!",
        closeOnConfirm: true
        html:true
    }, function() {
        $scope.onComment(record);
    });

Can you people help me to solve this sweet alert problem?

jordiburgos
  • 5,964
  • 4
  • 46
  • 80
  • 2
    please add some codes, what have you tried so far? – lin Sep 20 '17 at 08:46
  • As @lin said, provide code. And you can use AngularJS SweetAlert wrapper https://github.com/oitozero/ngSweetAlert – Zooly Sep 20 '17 at 08:48
  • swal({ title: "Are you sure?", text: 'Hiiii' , type: "info", showCancelButton: true, confirmButtonColor: "#F44336", confirmButtonText: "Yes, accept it!", closeOnConfirm: true html:true }, function() { $scope.onComment(record); }); – Siva Krishna Maddipati Sep 20 '17 at 08:50

2 Answers2

1

as Doc says :

html is no longer used. Instead use the content object.

(https://sweetalert.js.org/guides/)

try:

swal({
  content: "input",
});
federico scamuzzi
  • 3,708
  • 1
  • 17
  • 24
0

I found out how to do it in the new Version. Please see the information below.

sweet-alert display HTML code in text

米米米
  • 970
  • 7
  • 9