mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00:00
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:
parent
c2989f6cc6
commit
1084ccf7ef
1 changed files with 6 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue