diff options
| author | Misko Hevery | 2012-05-18 15:26:09 -0700 |
|---|---|---|
| committer | Misko Hevery | 2012-06-02 14:51:03 -0700 |
| commit | 8aa18f0ad036fd4f2dc26f54d80754c70232b4f7 (patch) | |
| tree | cc2eecd0b7a252ae372bc6c67605ae970984262a /src/ng | |
| parent | 85632cb44c95617d73c369f3a03fb476a4d5c8a2 (diff) | |
| download | angular.js-8aa18f0ad036fd4f2dc26f54d80754c70232b4f7.tar.bz2 | |
chore($location) switch to use $rootElement
Diffstat (limited to 'src/ng')
| -rw-r--r-- | src/ng/location.js | 8 | ||||
| -rw-r--r-- | src/ng/rootElement.js | 3 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/ng/location.js b/src/ng/location.js index 54abf6cb..c7b41605 100644 --- a/src/ng/location.js +++ b/src/ng/location.js @@ -405,7 +405,7 @@ function locationGetterSetter(property, preprocess) { * * @requires $browser * @requires $sniffer - * @requires $document + * @requires $rootElement * * @description * The $location service parses the URL in the browser address bar (based on the {@link https://developer.mozilla.org/en/window.location window.location}) and makes the URL available to your application. Changes to the URL in the address bar are reflected into $location service and changes to $location are reflected into the browser address bar. @@ -468,8 +468,8 @@ function $LocationProvider(){ } }; - this.$get = ['$rootScope', '$browser', '$sniffer', '$document', - function( $rootScope, $browser, $sniffer, $document) { + this.$get = ['$rootScope', '$browser', '$sniffer', '$rootElement', + function( $rootScope, $browser, $sniffer, $rootElement) { var currentUrl, basePath = $browser.baseHref() || '/', pathPrefix = pathPrefixFromBase(basePath), @@ -487,7 +487,7 @@ function $LocationProvider(){ var u = currentUrl, absUrlPrefix = composeProtocolHostPort(u.protocol(), u.host(), u.port()) + pathPrefix; - $document.bind('click', function(event) { + $rootElement.bind('click', function(event) { // TODO(vojta): rewrite link when opening in new tab/window (in legacy browser) // currently we open nice url link and redirect then diff --git a/src/ng/rootElement.js b/src/ng/rootElement.js index 7b72c2de..20e5bfc4 100644 --- a/src/ng/rootElement.js +++ b/src/ng/rootElement.js @@ -11,3 +11,6 @@ * location where the applications {@link angular.module.AUTO.$injector $injector} service gets * published, it can be retrieved using `$rootElement.injector()`. */ + + +// the implementation is in angular.bootstrap |
