I would like to create a confirmation-dialog-header directive that will open a Bootstrap UI Modal that will be used like this:
<button class="btn" confirmation-dialog-header="Non Working Dialog">
Non Working Dialog
</button>
Here is what I'm trying to do (CoffeeScript): Live Demo
app.directive 'confirmationDialogHeader', ->
restrict: 'A'
link: (scope, element, attrs) ->
$confirmationDialog = $ """
<div modal="confirmationDialog">
<div class="modal-header">
<h4>#{attrs.confirmationDialogHeader}</h4>
</div>
<div class="modal-body">
I want to be hidden by default
</div>
<div class="modal-footer">
<button class="btn" ng-click="confirmationDialog = false">
OK
</button>
</div>
</div>
"""
$(document.body).append($confirmationDialog)
$(element).click ->
scope.confirmationDialog = yes
Unfortunately, the modal is not hidden by default, and clicking the button doesn't seem to have any effect.
Any help would be appreciated.