From b2631f61709ae71bb29ec6f1353f2a3c1ad33cd3 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Tue, 4 Jan 2011 11:53:23 -0800 Subject: rename scope.$inject to scope.$service see changelog diff for more info --- src/Scope.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/Scope.js') diff --git a/src/Scope.js b/src/Scope.js index 27df770d..393e015b 100644 --- a/src/Scope.js +++ b/src/Scope.js @@ -578,7 +578,7 @@ function createScope(parent, providers, instanceCache) { foreach(Class.prototype, function(fn, name){ instance[name] = bind(instance, fn); }); - instance.$inject.apply(instance, concat([Class, instance], arguments, 1)); + instance.$service.apply(instance, concat([Class, instance], arguments, 1)); //TODO: backwards compatibility hack, remove when we don't depend on init methods if (isFunction(Class.prototype.init)) { @@ -615,7 +615,23 @@ function createScope(parent, providers, instanceCache) { if (!parent.$root) { instance.$root = instance; instance.$parent = instance; - (instance.$inject = createInjector(instance, providers, instanceCache))(); + + /** + * @workInProgress + * @ngdoc function + * @name angular.scope.$service + * @function + * + * @description + * Provides access to angular's dependency injector and + * {@link angular.service registered services}. In general the use of this api is discouraged, + * except for tests and components that currently don't support dependency injection (widgets, + * filters, etc). + * + * @param {string} serviceId String ID of the service to return. + * @returns {*} Value, object or function returned by the service factory function if any. + */ + (instance.$service = createInjector(instance, providers, instanceCache))(); } return instance; -- cgit v1.2.3