From 489b673ea4fe37e7cb09df68b18394221c1d871d Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Mon, 4 Nov 2013 22:04:57 -0600 Subject: [PATCH] Fixed #74 --- dist/js/ionic-angular.js | 8 ++++---- js/ext/angular/src/service/ionicActionSheet.js | 4 ++-- js/ext/angular/src/service/ionicPopup.js | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dist/js/ionic-angular.js b/dist/js/ionic-angular.js index cc4f8de823..1f25e54959 100644 --- a/dist/js/ionic-angular.js +++ b/dist/js/ionic-angular.js @@ -39,8 +39,8 @@ angular.module('ionic.service.actionSheet', ['ionic.service.templateLoad', 'ioni * * @param {object} opts the options for this ActionSheet (see docs) */ - show: function(opts) { - var scope = $rootScope.$new(true); + show: function(opts, $scope) { + var scope = $scope && $scope.$new() || $rootScope.$new(true); angular.extend(scope, opts); @@ -209,7 +209,7 @@ angular.module('ionic.service.popup', ['ionic.service.templateLoad']) }; return { - alert: function(message) { + alert: function(message, $scope) { // If there is an existing popup, just show that one var existing = getPopup(); @@ -224,7 +224,7 @@ angular.module('ionic.service.popup', ['ionic.service.templateLoad']) opts = angular.extend(defaults, opts); - var scope = $rootScope.$new(true); + var scope = $scope && $scope.$new() || $rootScope.$new(true); angular.extend(scope, opts); // Compile the template diff --git a/js/ext/angular/src/service/ionicActionSheet.js b/js/ext/angular/src/service/ionicActionSheet.js index 5267b1fbc8..1c9db95766 100644 --- a/js/ext/angular/src/service/ionicActionSheet.js +++ b/js/ext/angular/src/service/ionicActionSheet.js @@ -10,8 +10,8 @@ angular.module('ionic.service.actionSheet', ['ionic.service.templateLoad', 'ioni * * @param {object} opts the options for this ActionSheet (see docs) */ - show: function(opts) { - var scope = $rootScope.$new(true); + show: function(opts, $scope) { + var scope = $scope && $scope.$new() || $rootScope.$new(true); angular.extend(scope, opts); diff --git a/js/ext/angular/src/service/ionicPopup.js b/js/ext/angular/src/service/ionicPopup.js index 5071d1961b..e771a24bae 100644 --- a/js/ext/angular/src/service/ionicPopup.js +++ b/js/ext/angular/src/service/ionicPopup.js @@ -15,7 +15,7 @@ angular.module('ionic.service.popup', ['ionic.service.templateLoad']) }; return { - alert: function(message) { + alert: function(message, $scope) { // If there is an existing popup, just show that one var existing = getPopup(); @@ -30,7 +30,7 @@ angular.module('ionic.service.popup', ['ionic.service.templateLoad']) opts = angular.extend(defaults, opts); - var scope = $rootScope.$new(true); + var scope = $scope && $scope.$new() || $rootScope.$new(true); angular.extend(scope, opts); // Compile the template