angularjs - AngularUI modal custom scope -


i wanted define custom scope modal (i don't want use dependency injection reasons) using in project, i'm getting error whenever define scope in $modal.open. here plunk created example on angularui's website: http://plnkr.co/edit/rbtbpyqg7l39q1qydhns

i tried debugging , saw (modaloptions.scope || $rootscope) returns true custom scope , since true (obviously) doesn't have $new() function defined, exception thrown.

any thoughts?

you'll have pass scope instance:

var modalinstance = $modal.open({       animation: $scope.animationsenabled,       templateurl: 'mymodalcontent.html',       controller: 'modalinstancectrl',       size: size,       resolve: {         items: function () {           return $scope.items;         }       },       scope: $scope     }); 

you can pass own custom scope if don't want use controller's scope, working plnkr:

http://plnkr.co/edit/1gjtuvn45fgpc3jigyhv?p=preview


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -