fix(docs): Add $locationProvider methods to the docs example provider

- $locationProvider.html5Mode
- $locationProvider.hashPrefix

Docs example is basically a different application on the same page, but we don't want to instantiate multiple instances of $browser or $location service, so we are overriding these providers to return the instances from parent app.

Overriding the service with $provide.value caused a provider to be auto-generated without the necessary hashPrefix and html5Mode apis.
This commit is contained in:
Vojta Jina 2012-02-29 14:55:38 -08:00
parent c2989f6cc6
commit 1084ccf7ef

View file

@ -85,7 +85,12 @@ angular.module('ngdocs.directives', [], function($compileProvider) {
var modules = [
function($provide) {
$provide.value('$browser', $browser);
$provide.value('$location', $location);
$provide.service('$location', function() {
this.$get = function() {
return $location;
};
this.hashPrefix = this.html5Mode = angular.noop;
});
$provide.decorator('$defer', function($rootScope, $delegate) {
return angular.extend(function(fn, delay) {
if (delay && delay > 500) {