diff options
| author | Misko Hevery | 2012-05-18 14:53:11 -0700 |
|---|---|---|
| committer | Misko Hevery | 2012-06-02 14:50:58 -0700 |
| commit | 85632cb44c95617d73c369f3a03fb476a4d5c8a2 (patch) | |
| tree | a8c8b7e60d289362a8894bdc7af9dc7111f9d249 /src/Angular.js | |
| parent | 0a6e464a93d9a1e76a624b356054ce9ca4015f55 (diff) | |
| download | angular.js-85632cb44c95617d73c369f3a03fb476a4d5c8a2.tar.bz2 | |
feat($rootElement): added application root element
Publish the application root element as $rootElement
so that it can be injected to other services.
Diffstat (limited to 'src/Angular.js')
| -rw-r--r-- | src/Angular.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Angular.js b/src/Angular.js index 86689c0b..7c87cfd9 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -913,10 +913,13 @@ function angularInit(element, bootstrap) { function bootstrap(element, modules) { element = jqLite(element); modules = modules || []; + modules.unshift(['$provide', function($provide) { + $provide.value('$rootElement', element); + }]); modules.unshift('ng'); var injector = createInjector(modules); injector.invoke( - ['$rootScope', '$compile', '$injector', function(scope, compile, injector){ + ['$rootScope', '$rootElement', '$compile', '$injector', function(scope, element, compile, injector){ scope.$apply(function() { element.data('$injector', injector); compile(element)(scope); |
