Skip to content

Instantly share code, notes, and snippets.

@willrjmarshall
Created April 24, 2014 01:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willrjmarshall/11238834 to your computer and use it in GitHub Desktop.
Save willrjmarshall/11238834 to your computer and use it in GitHub Desktop.
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.contents = transclude()
console.log scope.contents
scope.cancel = ->
scope.modalInstance.dismiss("cancel")
elem.on "click", ->
scope.modalInstance = $modal.open(templateUrl: "<%= asset_path('modal.html') %>" )
# TEMPLATE modal.html
{{ contents }}
%a.close-reveal-modal{"ng-click" => "cancel()"} &#215;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment