mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 15:07:13 +08:00
Added alternative $scope inherit for Modal
This commit is contained in:
21
dist/js/ionic-angular.js
vendored
21
dist/js/ionic-angular.js
vendored
@ -2,6 +2,14 @@
|
|||||||
* Create a wrapping module to ease having to include too many
|
* Create a wrapping module to ease having to include too many
|
||||||
* modules.
|
* modules.
|
||||||
*/
|
*/
|
||||||
|
angular.module('ionic.service', [
|
||||||
|
'ionic.service.actionSheet',
|
||||||
|
'ionic.service.gesture',
|
||||||
|
'ionic.service.loading',
|
||||||
|
'ionic.service.modal',
|
||||||
|
'ionic.service.popup',
|
||||||
|
'ionic.service.templateLoad'
|
||||||
|
]);
|
||||||
|
|
||||||
angular.module('ionic.ui', [
|
angular.module('ionic.ui', [
|
||||||
'ionic.ui.content',
|
'ionic.ui.content',
|
||||||
@ -15,8 +23,9 @@ angular.module('ionic.ui', [
|
|||||||
|
|
||||||
angular.module('ionic', [
|
angular.module('ionic', [
|
||||||
'ionic.platform',
|
'ionic.platform',
|
||||||
'ionic.ui'
|
'ionic.service',
|
||||||
])
|
'ionic.ui',
|
||||||
|
]);
|
||||||
;
|
;
|
||||||
angular.module('ionic.service.actionSheet', ['ionic.service.templateLoad', 'ionic.ui.actionSheet'])
|
angular.module('ionic.service.actionSheet', ['ionic.service.templateLoad', 'ionic.ui.actionSheet'])
|
||||||
|
|
||||||
@ -153,9 +162,9 @@ angular.module('ionic.service.modal', ['ionic.service.templateLoad'])
|
|||||||
* A new isolated scope will be created for the
|
* A new isolated scope will be created for the
|
||||||
* modal and the new element will be appended into the body.
|
* modal and the new element will be appended into the body.
|
||||||
*/
|
*/
|
||||||
fromTemplate: function(templateString) {
|
fromTemplate: function(templateString, $scope) {
|
||||||
// Create a new isolated scope for the modal
|
// Create a new isolated scope for the modal
|
||||||
var scope = $rootScope.$new(true);
|
var scope = $scope && $scope.$new() || $rootScope.$new(true);
|
||||||
|
|
||||||
// Compile the template
|
// Compile the template
|
||||||
var element = $compile(templateString)(scope);
|
var element = $compile(templateString)(scope);
|
||||||
@ -165,10 +174,10 @@ angular.module('ionic.service.modal', ['ionic.service.templateLoad'])
|
|||||||
scope.modal = modal;
|
scope.modal = modal;
|
||||||
return modal;
|
return modal;
|
||||||
},
|
},
|
||||||
fromTemplateUrl: function(url, cb) {
|
fromTemplateUrl: function(url, cb, $scope) {
|
||||||
TemplateLoader.load(url).then(function(templateString) {
|
TemplateLoader.load(url).then(function(templateString) {
|
||||||
// Create a new isolated scope for the modal
|
// Create a new isolated scope for the modal
|
||||||
var scope = $rootScope.$new(true);
|
var scope = $scope && $scope.$new() || $rootScope.$new(true);
|
||||||
|
|
||||||
// Compile the template
|
// Compile the template
|
||||||
var element = $compile(templateString)(scope);
|
var element = $compile(templateString)(scope);
|
||||||
|
|||||||
13
js/ext/angular/src/ionicAngular.js
vendored
13
js/ext/angular/src/ionicAngular.js
vendored
@ -2,6 +2,14 @@
|
|||||||
* Create a wrapping module to ease having to include too many
|
* Create a wrapping module to ease having to include too many
|
||||||
* modules.
|
* modules.
|
||||||
*/
|
*/
|
||||||
|
angular.module('ionic.service', [
|
||||||
|
'ionic.service.actionSheet',
|
||||||
|
'ionic.service.gesture',
|
||||||
|
'ionic.service.loading',
|
||||||
|
'ionic.service.modal',
|
||||||
|
'ionic.service.popup',
|
||||||
|
'ionic.service.templateLoad'
|
||||||
|
]);
|
||||||
|
|
||||||
angular.module('ionic.ui', [
|
angular.module('ionic.ui', [
|
||||||
'ionic.ui.content',
|
'ionic.ui.content',
|
||||||
@ -15,5 +23,6 @@ angular.module('ionic.ui', [
|
|||||||
|
|
||||||
angular.module('ionic', [
|
angular.module('ionic', [
|
||||||
'ionic.platform',
|
'ionic.platform',
|
||||||
'ionic.ui'
|
'ionic.service',
|
||||||
])
|
'ionic.ui',
|
||||||
|
]);
|
||||||
|
|||||||
8
js/ext/angular/src/service/ionicModal.js
vendored
8
js/ext/angular/src/service/ionicModal.js
vendored
@ -9,9 +9,9 @@ angular.module('ionic.service.modal', ['ionic.service.templateLoad'])
|
|||||||
* A new isolated scope will be created for the
|
* A new isolated scope will be created for the
|
||||||
* modal and the new element will be appended into the body.
|
* modal and the new element will be appended into the body.
|
||||||
*/
|
*/
|
||||||
fromTemplate: function(templateString) {
|
fromTemplate: function(templateString, $scope) {
|
||||||
// Create a new isolated scope for the modal
|
// Create a new isolated scope for the modal
|
||||||
var scope = $rootScope.$new(true);
|
var scope = $scope && $scope.$new() || $rootScope.$new(true);
|
||||||
|
|
||||||
// Compile the template
|
// Compile the template
|
||||||
var element = $compile(templateString)(scope);
|
var element = $compile(templateString)(scope);
|
||||||
@ -21,10 +21,10 @@ angular.module('ionic.service.modal', ['ionic.service.templateLoad'])
|
|||||||
scope.modal = modal;
|
scope.modal = modal;
|
||||||
return modal;
|
return modal;
|
||||||
},
|
},
|
||||||
fromTemplateUrl: function(url, cb) {
|
fromTemplateUrl: function(url, cb, $scope) {
|
||||||
TemplateLoader.load(url).then(function(templateString) {
|
TemplateLoader.load(url).then(function(templateString) {
|
||||||
// Create a new isolated scope for the modal
|
// Create a new isolated scope for the modal
|
||||||
var scope = $rootScope.$new(true);
|
var scope = $scope && $scope.$new() || $rootScope.$new(true);
|
||||||
|
|
||||||
// Compile the template
|
// Compile the template
|
||||||
var element = $compile(templateString)(scope);
|
var element = $compile(templateString)(scope);
|
||||||
|
|||||||
Reference in New Issue
Block a user