1.4.5 • Published 9 years ago

angular-sgw-sweetalert v1.4.5

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

An angular directive which expose sweetalert in angular way. Based on the repo https://github.com/leftstick/angular-sweetalert/ and updated to load COmmonJS way

Requirements

Install

npm install sweetalert --save
npm install angular-sgw-sweetalert --save

Import

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>DEMO</title>
    <link rel="stylesheet" type="text/css" href="libs/sweet-alert.css">
</head>
<body>
    <script type="text/javascript" src="libs/sweet-alert.min.js"></script>
    <script type="text/javascript" src="libs/angular.min.js"></script>
    <script type="text/javascript" src="ngSweetAlert.js"></script>
</body>
</html>

Usage

var demo = angular.module('demo', ['hSweetAlert']);

demo.controller('demoController', function($scope, sweet) {
    $scope.basic = function() {
        sweet.show('Simple right?');
    };

    $scope.checkIfShown = function(){
        alert(sweet.isShown());
    };
});

See full featured demo: http://leftstick.github.io/angular-sweetalert/

LICENSE

MIT License