Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Commit

Permalink
fix(macModal): Fixed mac-modal firing $digest cycle
Browse files Browse the repository at this point in the history
Fixes #138
  • Loading branch information
adrianlee44 committed Nov 25, 2013
1 parent b1ce786 commit bfa9b37
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/directives/modal.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,6 @@ directive "macModal", [
modal.show attrs.macModal,
data: $parse(dataVar) $scope
scope: modalScope
modalScope.$apply()
return
]
5 changes: 2 additions & 3 deletions src/services/modal.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ angular.module("Mac").service("modal", [

# if modal is created thru module method "modal"
if options.moduleMethod?
renderModal = (template, invokeApply = true) =>
renderModal = (template) =>
viewScope =
if options.scope then options.scope.$new() else $rootScope.$new(true)
viewScope.modal = this
Expand All @@ -110,7 +110,6 @@ angular.module("Mac").service("modal", [
$compile(element) viewScope

showModal element
$rootScope.$apply() if invokeApply

if (path = options.templateUrl)
template = $templateCache.get path
Expand All @@ -119,7 +118,7 @@ angular.module("Mac").service("modal", [
else
$http.get(path).then (resp) ->
$templateCache.put path, resp.data
renderModal resp.data, false
renderModal resp.data
, ->
throw Error("Failed to load template: #{path}")
else if (template = options.template)
Expand Down

0 comments on commit bfa9b37

Please sign in to comment.