{"_id":"ngbootbox","_rev":"7-af4ad793f5a8d14912dc887f3fc29dc9","name":"ngbootbox","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.2":{"name":"ngbootbox","version":"0.1.2","keywords":["angularjs","bootbox","directive","service","alert","confirm","dialog","modal"],"author":{"name":"Erik Tufvesson"},"license":"MIT","_id":"ngbootbox@0.1.2","maintainers":[{"name":"eriktufvesson","email":"erik.tufvesson@gmail.com"}],"homepage":"https://github.com/eriktufvesson/ngBootbox","bugs":{"url":"https://github.com/eriktufvesson/ngBootbox/issues"},"dist":{"shasum":"9f812ffb6e3b6a924d4a930f9460e696fd9e8f10","tarball":"https://registry.npmjs.org/ngbootbox/-/ngbootbox-0.1.2.tgz","integrity":"sha512-N9U+ZyFHFm9vZfp1k3Rvev/71N72PE6Sk+OthfZoxwS6HrliHAZI6NlnUymB+w9WexWsQ8VmrWLtY/bXKPbqjA==","signatures":[{"sig":"MEYCIQCzqXbRtyt3QEcvvUXVgasOxSKuAZB3AVhmSybYgOcABgIhALzVLci1swVqmvX1siUUuHjQELd/FhWFlLZsUYYvSKSw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"dist/ngBootbox.js","_from":".","_shasum":"9f812ffb6e3b6a924d4a930f9460e696fd9e8f10","gitHead":"4d7d977d1864d6efd1c8c2b0d6689e56608445db","scripts":{},"_npmUser":{"name":"eriktufvesson","email":"erik.tufvesson@gmail.com"},"repository":{"url":"git+https://github.com/eriktufvesson/ngBootbox.git","type":"git"},"_npmVersion":"2.14.2","description":"AngularJS wrapper for bootbox.js","_nodeVersion":"4.0.0","dependencies":{"jquery":">=2.1.0","angular":">=1.3.0","bootbox":">=4.4.0","bootstrap":">=3.3.0"},"devDependencies":{"gulp":"^3.8.10","gulp-open":"^0.3.2","gulp-jshint":"^1.9.0","gulp-rename":"^1.2.0","gulp-uglify":"^1.0.1","gulp-connect":"^2.2.0","gulp-livereload":"^3.4.0","gulp-ng-annotate":"^0.5.0"},"directories":{}},"0.2.0":{"name":"ngbootbox","version":"0.2.0","keywords":["angularjs","bootbox","directive","service","alert","confirm","dialog","modal"],"author":{"name":"Erik Tufvesson"},"license":"MIT","_id":"ngbootbox@0.2.0","maintainers":[{"name":"eriktufvesson","email":"erik.tufvesson@gmail.com"}],"homepage":"https://github.com/eriktufvesson/ngBootbox","bugs":{"url":"https://github.com/eriktufvesson/ngBootbox/issues"},"dist":{"shasum":"51f5c575ecfd14715ce135c12e37091dc39a04bd","tarball":"https://registry.npmjs.org/ngbootbox/-/ngbootbox-0.2.0.tgz","integrity":"sha512-3wgU11e4tNEVNCC0iK/uARSoRlvUXUsxSLna2MopWj3FFVsrdVP573Bkly0E8n2tlq3R0xiyu5iY6OU4M7npaw==","signatures":[{"sig":"MEUCIQD36SxZQtotLlcjLx3ZjZ2aC4qtyCQzgiG8gNu6Wqut+wIgc2hDZe03/1iPOKF+IxYsqkVJCBCNHwL3alp+OTUvvso=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"dist/ngBootbox.js","_from":".","_shasum":"51f5c575ecfd14715ce135c12e37091dc39a04bd","gitHead":"fe0868323e4ee0779cb0fa2a39408cef0c445c53","scripts":{},"_npmUser":{"name":"eriktufvesson","email":"erik.tufvesson@gmail.com"},"repository":{"url":"git+https://github.com/eriktufvesson/ngBootbox.git","type":"git"},"_npmVersion":"4.5.0","description":"AngularJS wrapper for bootbox.js","_nodeVersion":"7.4.0","dependencies":{"jquery":">=2.1.0","angular":">=1.3.0","bootbox":">=4.4.0","bootstrap":">=3.3.0"},"devDependencies":{"gulp":"^3.8.10","gulp-open":"^0.3.2","gulp-jshint":"^1.9.0","gulp-rename":"^1.2.0","gulp-uglify":"^1.0.1","gulp-connect":"^2.2.0","gulp-livereload":"^3.4.0","gulp-ng-annotate":"^0.5.0"},"_npmOperationalInternal":{"tmp":"tmp/ngbootbox-0.2.0.tgz_1492587692600_0.9089769162237644","host":"packages-12-west.internal.npmjs.com"},"directories":{}}},"time":{"created":"2015-10-27T18:13:26.178Z","modified":"2024-10-22T17:26:54.393Z","0.1.2":"2015-10-27T18:13:26.178Z","0.2.0":"2017-04-19T07:41:34.853Z"},"bugs":{"url":"https://github.com/eriktufvesson/ngBootbox/issues"},"author":{"name":"Erik Tufvesson"},"license":"MIT","homepage":"https://github.com/eriktufvesson/ngBootbox","keywords":["angularjs","bootbox","directive","service","alert","confirm","dialog","modal"],"repository":{"url":"git+https://github.com/eriktufvesson/ngBootbox.git","type":"git"},"description":"AngularJS wrapper for bootbox.js","maintainers":[{"name":"eriktufvesson","email":"erik.tufvesson@gmail.com"}],"readme":"ngBootbox\n=========\n\nAngularJS wrapper for Bootbox.js. Bootbox.js allowes you to easily make use of Twitter Bootstrap modals for javascript alerts, confirms and prompts. ngBootbox includes three directives, one for each of alert, confirm and prompt.\n\nInstallation\n=========\n\n    bower install ngBootbox\n\n    npm install ngbootbox\n\nDevelopment mode\n----------------\n    <head>\n        <script src=\"bower_components/jquery/dist/jquery.js\"></script>\n        <script src=\"bower_components/angular/angular.js\"></script>\n        <script src=\"bower_components/bootstrap/dist/js/bootstrap.js\"></script>\n        <script src=\"bower_components/bootbox/bootbox.js\"></script>\n        <script src=\"bower_components/ngBootbox/dist/ngBootbox.js\"></script>\n    </head>\n\nProduction mode\n---------------\n    <head>\n        <script src=\"bower_components/jquery/dist/jquery.min.js\"></script>\n        <script src=\"bower_components/angular/angular.min.js\"></script>\n        <script src=\"bower_components/bootstrap/dist/js/bootstrap.min.js\"></script>\n        <script src=\"bower_components/bootbox/bootbox.js\"></script>\n        <script src=\"bower_components/ngBootbox/dist/ngBootbox.min.js\"></script>\n    </head>\n\nInitialize module\n-----------------\n    angular.module('yourApp', ['ngBootbox']);\n\nMinification\n------------\n\nngBootbox is minification safe, so to minify your own development files, use [Gulp](http://gulpjs.com/) or [Grunt](http://gruntjs.com/) with [ngAnnotate](https://github.com/olov/ng-annotate) ([gulp-ng-annotate](https://www.npmjs.org/package/gulp-ng-annotate/) or [grunt-ng-annotate](https://www.npmjs.org/package/grunt-ng-annotate)).\n\nDemo\n====\n\nVisit this page for a working [demo](http://eriktufvesson.github.io/ngbootbox/ \"ngBootbox\").\n    \n\nDirectives\n==========\n\nng-bootbox-alert\n----------------\n\n    <button class=\"btn btn-default\" ng-bootbox-alert=\"Alert message!\">\n        Alert\n    </button>\n\nng-bootbox-confirm\n------------------\n\n    <button class=\"btn btn-lg btn-primary\" ng-bootbox-confirm=\"Are you sure you want to confirm this?\"\n            ng-bootbox-confirm-action=\"confirmCallbackMethod(attr1, attr2)\" ng-bootbox-confirm-action-cancel=\"confirmCallbackCancel(attr1, attr2)\">\n        Confirm\n    </button>\n\nng-bootbox-prompt\n-----------------\n\n    <button class=\"btn btn-lg btn-primary\" ng-bootbox-prompt=\"Please type in your name\"\n            ng-bootbox-prompt-action=\"promptCallback(result)\" ng-bootbox-prompt-action-cancel=\"promptCallbackCancelled(result)\">\n        Prompt\n    </button>\n\nng-bootbox-custom-dialog\n------------------------\n\n    <button class=\"btn btn-lg btn-primary\"\n            ng-bootbox-title=\"A cool title!\"\n            ng-bootbox-custom-dialog=\"Some custom text\"\n            ng-bootbox-buttons=\"customDialogButtons\"\n            ng-bootbox-class-name=\"some-class\">\n        Custom dialog\n    </button>\n\n    <script>\n        $scope.customDialogButtons = {\n            warning: {\n                label: \"Warning!\",\n                className: \"btn-warning\",\n                callback: function() { $scope.addAction('Warning', false); }\n            },\n            success: {\n                label: \"Success!\",\n                className: \"btn-success\",\n                callback: function() { $scope.addAction('Success!', true) }\n            },\n            danger: {\n                label: \"Danger!\",\n                className: \"btn-danger\",\n                callback: function() { $scope.addAction('Danger!', false) }\n            },\n            main: {\n                label: \"Click ME!\",\n                className: \"btn-primary\",\n                callback: function() { $scope.addAction('Main...!', true) }\n            }\n        };\n        </script>\n\nCustom dialog with HTML Template\n--------------------------------\n\n    <button class=\"btn btn-lg btn-primary\"\n            ng-bootbox-title=\"A cool title!\"\n            ng-bootbox-custom-dialog\n            ng-bootbox-custom-dialog-template=\"custom-dialog.tpl.html\"\n            ng-bootbox-buttons=\"customDialogButtons\">\n        Custom dialog with template\n    </button>\n\nCustom dialog options\n---------------------\n\nAn options object can also be used to configure a custom dialog. A full list of available options can be found in the official Bootbox.js [documentation](http://bootboxjs.com/documentation.html).\n\n    <button class=\"btn btn-lg btn-success\"\n            ng-bootbox-custom-dialog\n            ng-bootbox-options=\"customDialogOptions\">\n        Custom dialog options\n    </button>\n\n    <script>\n        $scope.customDialogOptions = {\n            message: 'This is a message!',\n            title: 'The best title!',\n            onEscape: function() {\n              $log.info('Escape was pressed');\n            },\n            show: true,\n            backdrop: false,\n            closeButton: true,\n            animate: true,\n            className: 'test-class',\n            buttons: {\n                warning: {\n                    label: \"Cancel\",\n                    className: \"btn-warning\",\n                    callback: function() { ... }\n                },\n                success: {\n                    label: \"Ok\",\n                    className: \"btn-success\",\n                    callback: function() { ... }\n                }\n            }\n        };\n    </script>\n    \nScope passing to custom dialog\n------------------------------\nYou can pass `$scope` to a custom dialog by specifying the `scope` parameter in options.\n\n    <script>\n        $scope.customDialogOptions = {\n            templateUrl: 'customModal.html',\n            scope: $scope,\n            title: 'The best title!',\n            buttons: {\n                warning: {\n                    label: \"Cancel\",\n                    className: \"btn-warning\",\n                    callback: function() { ... }\n                },\n                success: {\n                    label: \"Ok\",\n                    className: \"btn-success\",\n                    callback: function() { ... }\n                }\n            }\n        };\n    </script>\n    \nThis allows your modal to interact with your controller's scope and bind data in a custom template.\n\n$ngBootbox service\n==================\n\nThe $ngBootbox service can be used to utilize bootbox.js from within your angular code.\n\nUsage\n-----\nInject the **$ngBootbox** service in your own angular controller, service, directive, etc.\n\n    angular.module('yourApp')\n        .controller('yourCtrl', function($ngBootbox) { ... });\n\n\nMethods\n-------\n\n### $ngBootbox.alert(msg)\n\nReturns a promise that is resolved when the dialog is closed.\n\n**Example**\n\n    $ngBootbox.alert('An important message!')\n        .then(function() {\n            console.log('Alert closed');\n        });\n        \n    $ngBootbox.alert({message:'Another important message!', title:'Ops!'})\n        .then(function() {\n            console.log('Alert closed');\n        });\n\n### $ngBootbox.confirm(msg)\n\nReturns a promise that is resolved when if confirmed and rejected if dismissed.\n\n**Example**\n\n    $ngBootbox.confirm('A question?')\n        .then(function() {\n            console.log('Confirmed!');\n        }, function() {\n            console.log('Confirm dismissed!');\n        });\n        \n    $ngBootbox.confirm({message:\"Another question?\", title:'Please answer'})\n        .then(function() {\n            console.log('Confirmed!');\n        }, function() {\n            console.log('Confirm dismissed!');\n        });\n        \n### $ngBootbox.prompt(msg)\n\nReturns a promise that is resolved when submitted and rejected if dismissed.\n\n**Example**\n\n    $ngBootbox.prompt('Enter something')\n        .then(function(result) {\n            console.log('Prompt returned: ' + result);\n        }, function() {\n            console.log('Prompt dismissed!');\n        });\n\n### $ngBootbox.customDialog(options)\n\n**Example**\n\n    var options = {\n            message: 'This is a message!',\n            title: 'The title!',\n            className: 'test-class',\n            buttons: {\n                 warning: {\n                     label: \"Cancel\",\n                     className: \"btn-warning\",\n                     callback: function() { ... }\n                 },\n                 success: {\n                     label: \"Ok\",\n                     className: \"btn-success\",\n                     callback: function() { ... }\n                 }\n            }\n        };\n\n    $ngBootbox.customDialog(options);\n\nA full list of available options can be found in the official Bootbox.js [documentation](http://bootboxjs.com/documentation.html).\n\n### Update\n\n**New in 0.0.4:** There is now support for specifying a HTML template also when using the $ngBootbox service for displaying custom dialogs.\n\n    $scope.customDialogOptions = {\n    templateUrl: 'custom-dialog.tpl.html',\n    scope: $scope,\n         title: 'The title!',\n         buttons: $scope.customDialogButtons\n    };\n\nWhen doing this, the message property will be overwritten by the content of the HTML template.\n\n\n### $ngBootbox.setDefaults(options)\n\nUsed to set default values for all your Bootbox alerts, confirms, prompts and dialogs.\n\n**Example**\n\n    $ngBootbox.setDefaults({\n        animate: false,\n        backdrop: false\n    });\n\nA full list of available options can be found in the official Bootbox.js [documentation](http://bootboxjs.com/documentation.html).\n\n### $ngBootbox.hideAll()\n\nHide all currently active bootbox dialogs.\n\n**Example**\n\n    $ngBootbox.hideAll();\n\n### $ngBootbox.addLocale(String name, object values)\n\nAllows the user to add a custom translation for each of the built-in command buttons. The values object should be in this format:\n\n    {\n        OK : '',\n        CANCEL : '',\n        CONFIRM : ''\n    }\n\n### $ngBootbox.removeLocale(String name)\n\nAllows the user to remove a locale from the available locale settings.\n\n### $ngBootbox.setLocale(String name)\n\nAllows the user to select a locale rather than using setDefaults(\"locale\", ...).\n\n\n\nConfiguration\n============\n\n$ngBootboxConfigProvider\n------------------------\n\n    angular.module('yourApp')\n        .config(function($ngBootboxConfigProvider) {\n            $ngBootboxConfigProvider.setDefaultLocale('sv');\n            \n            $ngBootboxConfigProvider.addLocale('ex', { OK: 'OK', CANCEL: 'Avbryt', CONFIRM: 'Bekräfta' });\n            \n            $ngBootboxConfigProvider.removeLocale('ex');\n         })\n         .controller('TestCtrl', function($ngBootboxConfig) {\n            var defaultLocale = $ngBootboxConfig.getDefaultLocale();  \n         });\n","readmeFilename":"README.md","users":{"dpjayasekara":true}}