aboutsummaryrefslogtreecommitdiffstats
path: root/src/Angular.js
diff options
context:
space:
mode:
authorMisko Hevery2011-10-17 16:56:56 -0700
committerMisko Hevery2011-11-14 16:39:31 -0800
commit48697a2b86dbb12ea8de64cc5fece7caf68b321e (patch)
tree1fa50659f0bb5de2640dea2a2e5bb5628f2bb14a /src/Angular.js
parent93b777c916ccff243c5a6080bf5f39860ac7bf39 (diff)
downloadangular.js-48697a2b86dbb12ea8de64cc5fece7caf68b321e.tar.bz2
refactor(injector): turn scope into a service
- turn scope into a $rootScope service. - injector is now a starting point for creating angular application. - added inject() method which wraps jasmine its/beforeEach/afterEach, and which allows configuration and injection of services. - refactor tests to use inject() where possible BREAK: - removed angular.scope() method
Diffstat (limited to 'src/Angular.js')
-rw-r--r--src/Angular.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Angular.js b/src/Angular.js
index f1eb74ca..0ef1af8e 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -952,8 +952,12 @@ function angularInit(config, document){
var autobind = config.autobind;
if (autobind) {
- var element = isString(autobind) ? document.getElementById(autobind) : document;
- compile(element)().$apply();
+ var element = isString(autobind) ? document.getElementById(autobind) : document,
+ injector = createInjector(),
+ scope = injector('$rootScope');
+
+ compile(element)(scope);
+ scope.$apply();
}
}