       options       = @opened.options
 
       if options.keyboard
-        $(document)[action] "keydown", escapeKeyHandler
+        angular.element(document)[action] "keydown", escapeKeyHandler
 
       if options.resize
-        $(window)[action] "resize", resizeHandler
+        angular.element(window)[action] "resize", resizeHandler
 
     #
     # @name register

      element = modalObject.element
      options = modalObject.options

      modal  = $(".modal", element).attr "style", ""
      height = modal.outerHeight()
      width  = modal.outerWidth()

      css =
        if $(window).height() > height
          marginTop:  -height / 2
        else
          top: options.topOffset
      css.marginLeft = -width / 2

      modal.css css

    #
    # @name hide

            viewScope              = $rootScope.$new()
            viewScope.modal        = this
            viewScope.closeOverlay = ($event) =>
              if options.overlayClose and
                  angular.element($event.target).hasClass("modal-overlay")
                @hide()

            if options.controller
