Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
スイートアラート内でangularjsコードをレンダリングしたい、例
$scope.someVar = 'test'; swal("Title", "{ someVar }", "success")
どうすればそれを達成できますか?
$interpolate サービスをご覧ください
チェック例:
swal("Title", $interpolate("{{someVar}}")($scope), "success");
someVar を括弧で囲む必要はありませんが、$scope.someVar で呼び出す必要があります (javascript を使用しています!)。したがって、例は次のようになります。
sweetAlert({ title: $scope.someTitle, text: $scope.someVar, }