I am new to AngularJS so not aware of events of this. I have a requirement that I have jQuery bootstrap library. I want to open that bootstrap confirmbox when I click on a button and based on ok and cancel want to take further action But want to call using AgularJS
1 Answer
First if at all possible, if you intend to use angular try not to use jQuery functionality, unless it is a last resort.
In order to accomplish what you want you would need to write a angular directive that handles the confirm box and then use it any where you need confirmations. The directive can be setup to further handle actions on ok and cancel. Something similar to this might give you a stating point.
app.directive('ngConfirm', [
function(){
return {
restrict: 'A',
link: function (scope, element, attrs) {
element.bind('click',function () {
var message = attrs.ngConfirmMessage || "Are you sure?"
if (message && confirm(message) ) {
scope.$apply(attrs.ngConfirm)
}
});
}
};
}])
and then in the html
<tag ng-Confirm-Message="Some message" ng-Confirm="someAction()"></tag>