From d7686a429c43fd031a0d39788973f726d74bdb33 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Mon, 31 Jan 2011 23:48:04 -0800 Subject: add $route.parent for setting parentScope --- src/services.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') diff --git a/src/services.js b/src/services.js index d6a7fb0a..b549292f 100644 --- a/src/services.js +++ b/src/services.js @@ -681,6 +681,23 @@ angularServiceInject('$route', function(location) { */ onChange: bind(onChange, onChange.push), + /** + * @workInProgress + * @ngdoc method + * @name angular.service.$route#parent + * @methodOf angular.service.$route + * + * @param {Scope} [scope=rootScope] Scope to be used as parent for newly created + * `$route.current.scope` scopes. + * + * @description + * Sets a scope to be used as the parent scope for scopes created on route change. If not + * set, defaults to the root scope. + */ + parent: function(scope) { + if (scope) parentScope = scope; + }, + /** * @workInProgress * @ngdoc method -- cgit v1.2.3