Ok thank you so much, now it is working as an angular directive.
This is how I do it, maybe this could help someone:
public const string Bootstrap_Confirmation = "~/libs/bootstrap-confirmation/bootstrap-confirmation.min.js";
bundles.Add(
new ScriptBundle("~/Bundles/App/libs/js")
.Include(
ScriptPaths.Json2,
ScriptPaths.JQuery,
ScriptPaths.JQuery_Migrate,
ScriptPaths.Bootstrap,
...
ScriptPaths.Bootstrap_Confirmation,
...
now, you can create an angular directive as you want:
(function () {
appModule.directive('bowConfirmation', [
function () {
return {
restrict: 'A',
scope: {
bowConfirmationOptions: '=',
bowConfirmationOK: '&',
bowConfirmationCancel: '&',
},
link: function ($scope, element, attrs) {
$(element).attr('data-toggle', 'confirmation');
$(element).data($scope.bowConfirmationOptions);
//OK click
$(element).on("confirmed.bs.confirmation", function () {
$scope.bowConfirmationOK();
});
//Cancel click
$(element).on("canceled.bs.confirmation", function () {
$scope.bowConfirmationCancel();
});
}
};
}
]);
})();
finally you can use your confirmation directive:
<button class="btn btn-default" bow-confirmation bow-confirmation-OK="vm.yes()" bow-confirmation-options='{"title": "New Title", "singleton": true}'>Confirmation</button>
Thanks.