Created
April 24, 2014 03:45
-
-
Save willrjmarshall/11240782 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Darkswarm.directive "ofnModal", ($modal)-> | |
restrict: 'E' | |
replace: true | |
transclude: true | |
template: "<a>{{title}}</a>" | |
link: (scope, elem, attrs, ctrl, transclude)-> | |
scope.title = attrs.title | |
scope.cancel = -> | |
scope.modalInstance.dismiss("cancel") | |
template = transclude().add("<a class='close-reveal-modal' 'ng-click'='cancel()'>×</a>") | |
# ng-click doesn't work here! Is the scope wrong? How can I set it correctly? | |
elem.on "click", -> | |
scope.modalInstance = $modal.open(template: template) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment