{"id":7790,"date":"2015-10-27T07:42:57","date_gmt":"2015-10-27T07:42:57","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2015\/10\/27\/ionic-angularjs-sweetalert-not-running-function-open-source-projects-t4t5-sweetalert\/"},"modified":"2015-10-27T07:42:57","modified_gmt":"2015-10-27T07:42:57","slug":"ionic-angularjs-sweetalert-not-running-function-open-source-projects-t4t5-sweetalert","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2015\/10\/27\/ionic-angularjs-sweetalert-not-running-function-open-source-projects-t4t5-sweetalert\/","title":{"rendered":"Ionic Angularjs &#8211; Sweetalert not running function-open source projects t4t5\/sweetalert"},"content":{"rendered":"<p>I have used SweetAlert before with success but today I tried using it with Ionic and I have a problem. When I use it like this it executes the something function but it&#8217;s not waiting for the confirm button to be pressed:<\/p>\n<pre><code>$scope.something=function(){console.log('test')};\nswal({title: 'True',text: '',type: 'success',confirmButtonText: 'Next' },$scope.something());\n<\/code><\/pre>\n<p>When I use it like this, it&#8217;s not working at all:<\/p>\n<pre><code>swal({title: 'True',text: '',type: 'success',confirmButtonText: 'Next' },function(){console.log('test')});\n<\/code><\/pre>\n<p>Any ideas?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have used SweetAlert before with success but today I tried using it with Ionic and I have a problem. When I use it like this it executes the something function but it&#8217;s not waiting for the confirm button to be pressed: $scope.something=function(){console.log(&#8216;test&#8217;)}; swal({title: &#8216;True&#8217;,text: &#8221;,type: &#8216;success&#8217;,confirmButtonText: &#8216;Next&#8217; },$scope.something()); When I use it like this, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7790","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7790","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7790"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7790\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7790"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7790"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7790"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}