mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-05 08:59:35 +08: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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user