Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 9eafd10

Browse files
committed
docs(guide/location): fix example
1 parent 3436c02 commit 9eafd10

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

docs/content/guide/dev_guide.services.$location.ngdoc

+20-22
Original file line numberDiff line numberDiff line change
@@ -372,27 +372,27 @@ In this examples we use `<base href="/base/index.html" />`
372372
<div ng-non-bindable class="html5-hashbang-example">
373373
<div id="html5-mode" ng-controller="Html5Cntl">
374374
<h3>Browser with History API</h3>
375-
<ng-address-bar browser="html5"></ng-address-bar><br /><br />
376-
$location.protocol() = {{$location.protocol()}}<br />
377-
$location.host() = {{$location.host()}}<br />
378-
$location.port() = {{$location.port()}}<br />
379-
$location.path() = {{$location.path()}}<br />
380-
$location.search() = {{$location.search()}}<br />
381-
$location.hash() = {{$location.hash()}}<br />
375+
<div ng-address-bar browser="html5"></div><br><br>
376+
$location.protocol() = {{$location.protocol()}}<br>
377+
$location.host() = {{$location.host()}}<br>
378+
$location.port() = {{$location.port()}}<br>
379+
$location.path() = {{$location.path()}}<br>
380+
$location.search() = {{$location.search()}}<br>
381+
$location.hash() = {{$location.hash()}}<br>
382382
<a href="/base/first?a=b">/base/first?a=b</a> |
383383
<a href="sec/ond?flag#hash">sec/ond?flag#hash</a> |
384384
<a href="/base/another?search" ng-ext-link>external</a>
385385
</div>
386386

387387
<div id="hashbang-mode" ng-controller="HashbangCntl">
388388
<h3>Browser without History API</h3>
389-
<ng-address-bar browser="hashbang"></ng-address-bar><br /><br />
390-
$location.protocol() = {{$location.protocol()}}<br />
391-
$location.host() = {{$location.host()}}<br />
392-
$location.port() = {{$location.port()}}<br />
393-
$location.path() = {{$location.path()}}<br />
394-
$location.search() = {{$location.search()}}<br />
395-
$location.hash() = {{$location.hash()}}<br />
389+
<div ng-address-bar browser="hashbang"></div><br><br>
390+
$location.protocol() = {{$location.protocol()}}<br>
391+
$location.host() = {{$location.host()}}<br>
392+
$location.port() = {{$location.port()}}<br>
393+
$location.path() = {{$location.path()}}<br>
394+
$location.search() = {{$location.search()}}<br>
395+
$location.hash() = {{$location.hash()}}<br>
396396
<a href="/base/first?a=b">/base/first?a=b</a> |
397397
<a href="sec/ond?flag#hash">sec/ond?flag#hash</a> |
398398
<a href="/base/another?search" ng-ext-link>external</a>
@@ -417,7 +417,6 @@ In this examples we use `<base href="/base/index.html" />`
417417
return baseHref;
418418
};
419419

420-
this.hover = angular.noop;
421420
this.notifyWhenOutstandingRequests = angular.noop;
422421
}
423422

@@ -426,20 +425,19 @@ In this examples we use `<base href="/base/index.html" />`
426425
hashbang: new FakeBrowser('http://www.host.com/base/index.html#!/path?a=b#h', '/base/index.html')
427426
};
428427

429-
function Html5Cntl($location) {
430-
this.$location = $location;
428+
function Html5Cntl($scope, $location) {
429+
$scope.$location = $location;
431430
}
432431

433-
function HashbangCntl($location) {
434-
this.$location = $location;
432+
function HashbangCntl($scope, $location) {
433+
$scope.$location = $location;
435434
}
436435

437436
function initEnv(name) {
438437
var root = angular.element(document.getElementById(name + '-mode'));
439438
angular.bootstrap(root, [function($compileProvider, $locationProvider, $provide){
440-
$locationProvider.html5Mode = true;
441-
$locationProvider.hashPrefix = '!';
442-
439+
$locationProvider.html5Mode(true).hashPrefix('!');
440+
443441
$provide.value('$browser', browsers[name]);
444442
$provide.value('$document', root);
445443
$provide.value('$sniffer', {history: name == 'html5'});

0 commit comments

Comments
 (0)