       element = modalObject.element
       options = modalObject.options
 
-      modal  = $(".modal", element).attr "style", ""
+      modal  = angular.element(element[0].getElementsByClassName "modal").attr "style", ""
       height = modal.outerHeight()
       width  = modal.outerWidth()
 
       css =
-        if $(window).height() > height
+        if angular.element(window).height() > height
           marginTop:  -height / 2
         else
           top: options.topOffset
       css.marginLeft = -width / 2
 
-      modal.css css
+      angular.forEach css, (value, key) ->
+        if not isNaN(+value) and angular.isNumber +value
+          value = "#{value}px"
+        modal.css key, value
 
     #
     # @name hide

      options       = @opened.options

      if options.keyboard
        $(document)[action] "keydown", escapeKeyHandler

      if options.resize
        $(window)[action] "resize", resizeHandler

    #
    # @name register


            angular.extend options.attributes, {id}
            element = angular.element(@modalTemplate).attr options.attributes
            wrapper = angular.element element[0].getElementsByClassName("modal-content-wrapper")
            wrapper.html template
            angular.element(document.body).append $compile(element) viewScope

            showModal element

