Skip to content

regisluo/angular-easymodal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Angular-EasyModal-alert-confirm

This easyModal can be used in AngularJS-base web applications, which is an alternative of JS alert and
confirm dialog with enhanced functionality(html template,css,callback and passed in arguments,external controller),
more flexible, better user experience.

##Dependencies Requires AngularJS v1.4.0+ and Bootstrap's CSS.

Overview

example page

Alert Example

    emodal.alert("Messages go here!");

You will get the following modal:
example page

Confirm Example

           emodal.confirm("Are you sure to delete?",
               function(){
                   $scope.data='You have clicked OK!';
               },
               function(){
                   $scope.data='You have clicked Cancel!';
               }
           );
        };

You will get the following modal:
example page

Modal Example

        emodal.modal("../partials/externalTemplate.html",
                {
                title:'Callback Function',
                okCallback:okCallbackFun,
                okArgs:{id:1},
                cancelCallback:cancelCallbackFun,
                cancelArgs:{info:'some text'}
               });
        var okCallbackFun = function (arg) {
            $scope.data = '[ok callback] Parameter: '+arg.id;
        };
        var cancelCallbackFun = function (arg) {
            $scope.data = '[cancel callback] Parameter: '+arg.info;
        };                 

You will get the following modal:
example page

License

It is available under the MIT license.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published