@@ -372,27 +372,27 @@ In this examples we use `<base href="/base/index.html" />`
372
372
<div ng-non-bindable class="html5-hashbang-example">
373
373
<div id="html5-mode" ng-controller="Html5Cntl">
374
374
<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>
382
382
<a href="/base/first?a=b">/base/first?a=b</a> |
383
383
<a href="sec/ond?flag#hash">sec/ond?flag#hash</a> |
384
384
<a href="/base/another?search" ng-ext-link>external</a>
385
385
</div>
386
386
387
387
<div id="hashbang-mode" ng-controller="HashbangCntl">
388
388
<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>
396
396
<a href="/base/first?a=b">/base/first?a=b</a> |
397
397
<a href="sec/ond?flag#hash">sec/ond?flag#hash</a> |
398
398
<a href="/base/another?search" ng-ext-link>external</a>
@@ -417,7 +417,6 @@ In this examples we use `<base href="/base/index.html" />`
417
417
return baseHref;
418
418
};
419
419
420
- this.hover = angular.noop;
421
420
this.notifyWhenOutstandingRequests = angular.noop;
422
421
}
423
422
@@ -426,20 +425,19 @@ In this examples we use `<base href="/base/index.html" />`
426
425
hashbang: new FakeBrowser('http://www.host.com/base/index.html#!/path?a=b#h', '/base/index.html')
427
426
};
428
427
429
- function Html5Cntl($location) {
430
- this .$location = $location;
428
+ function Html5Cntl($scope, $ location) {
429
+ $scope .$location = $location;
431
430
}
432
431
433
- function HashbangCntl($location) {
434
- this .$location = $location;
432
+ function HashbangCntl($scope, $ location) {
433
+ $scope .$location = $location;
435
434
}
436
435
437
436
function initEnv(name) {
438
437
var root = angular.element(document.getElementById(name + '-mode'));
439
438
angular.bootstrap(root, [function($compileProvider, $locationProvider, $provide){
440
- $locationProvider.html5Mode = true;
441
- $locationProvider.hashPrefix = '!';
442
-
439
+ $locationProvider.html5Mode(true).hashPrefix('!');
440
+
443
441
$provide.value('$browser', browsers[name]);
444
442
$provide.value('$document', root);
445
443
$provide.value('$sniffer', {history: name == 'html5'});
0 commit comments