Skip to content

Instantly share code, notes, and snippets.

@willrjmarshall
Created May 20, 2014 02:06
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/12f75bcf72751e9e0933 to your computer and use it in GitHub Desktop.
Save willrjmarshall/12f75bcf72751e9e0933 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
contents = null
transclude scope, (clone)->
contents = clone
scope.cancel = ->
console.log scope # Scope ID 002
#scope.modalInstance.dismiss("cancel")
elem.on "click", ->
scope.modalInstance = $modal.open(controller: ctrl, template: contents)
console.log scope # Scope ID 007 / child of 002
console.log scope.modalInstance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment