ng-alertify
Advanced tools
Comparing version 0.3.0 to 0.4.0
{ | ||
"name": "ng-alertify", | ||
"main": "ng-alertify.js", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "ignore": [ |
@@ -41,4 +41,17 @@ // mock AngularJS proxy to window.alertify | ||
// transform .prompt(message) into promise-returning method | ||
alertifyProxy.prompt = function (message, defaultValue) { | ||
var defer = $q.defer(); | ||
alertify.prompt(message, function (yes, answer) { | ||
if (yes) { | ||
defer.resolve(answer); | ||
} else { | ||
defer.reject(); | ||
} | ||
}, defaultValue); | ||
return defer.promise; | ||
}; | ||
return alertifyProxy; | ||
}]); | ||
}(window.angular, window.alertify)); |
{ | ||
"name": "ng-alertify", | ||
"description": "AngularJS wrapper around alertify popup library", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"author": "Gleb Bahmutov <gleb@kensho.com>", | ||
@@ -6,0 +6,0 @@ "bugs": { |
@@ -37,2 +37,6 @@ # ng-alertify | ||
); | ||
Alertify.prompt('Your age', 21).then( | ||
function onOk(answer) {...}, | ||
function onCancel() { ... } | ||
); | ||
}); | ||
@@ -43,2 +47,4 @@ ``` | ||
Works well with [confirm-click](https://github.com/bahmutov/confirm-click). | ||
## License | ||
@@ -45,0 +51,0 @@ |
Sorry, the diff of this file is not supported yet
233422
5142
82