Created
December 2, 2016 06:04
-
-
Save alfredhot/7a0d116e434e2688e2085fbf57aa6a03 to your computer and use it in GitHub Desktop.
JavaScript 에서 sweetalert 을 쉽게 사용하기
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$rootScope.showAlert= (content, type, fn) -> | |
if fn is null | |
fn = -> | |
null | |
if type is null | |
swal $rootScope.popup.title, content | |
.then fn | |
else | |
swal $rootScope.popup.title, content, type | |
.then fn | |
$rootScope.showWarning = (content, fn) -> | |
$rootScope.showAlert(content, "warning", fn) | |
$rootScope.showError = (content, fn) -> | |
$rootScope.showAlert(content, "error", fn) | |
$rootScope.showSuccess = (content, fn) -> | |
$rootScope.showAlert(content, "success", fn) | |
$rootScope.sweet= (option,fn) -> | |
option.title = $rootScope.popup.title | |
swal option,fn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
fff