Browser with History API
-
- $location.protocol() = {{$location.protocol()}}
- $location.host() = {{$location.host()}}
- $location.port() = {{$location.port()}}
- $location.path() = {{$location.path()}}
- $location.search() = {{$location.search()}}
- $location.hash() = {{$location.hash()}}
+
+ $location.protocol() = {{$location.protocol()}}
+ $location.host() = {{$location.host()}}
+ $location.port() = {{$location.port()}}
+ $location.path() = {{$location.path()}}
+ $location.search() = {{$location.search()}}
+ $location.hash() = {{$location.hash()}}
/base/first?a=b |
sec/ond?flag#hash |
external
@@ -386,13 +386,13 @@ In this examples we use `
`
Browser without History API
-
- $location.protocol() = {{$location.protocol()}}
- $location.host() = {{$location.host()}}
- $location.port() = {{$location.port()}}
- $location.path() = {{$location.path()}}
- $location.search() = {{$location.search()}}
- $location.hash() = {{$location.hash()}}
+
+ $location.protocol() = {{$location.protocol()}}
+ $location.host() = {{$location.host()}}
+ $location.port() = {{$location.port()}}
+ $location.path() = {{$location.path()}}
+ $location.search() = {{$location.search()}}
+ $location.hash() = {{$location.hash()}}
/base/first?a=b |
sec/ond?flag#hash |
external
@@ -417,7 +417,6 @@ In this examples we use `
`
return baseHref;
};
- this.hover = angular.noop;
this.notifyWhenOutstandingRequests = angular.noop;
}
@@ -426,20 +425,19 @@ In this examples we use `
`
hashbang: new FakeBrowser('http://www.host.com/base/index.html#!/path?a=b#h', '/base/index.html')
};
- function Html5Cntl($location) {
- this.$location = $location;
+ function Html5Cntl($scope, $location) {
+ $scope.$location = $location;
}
- function HashbangCntl($location) {
- this.$location = $location;
+ function HashbangCntl($scope, $location) {
+ $scope.$location = $location;
}
function initEnv(name) {
var root = angular.element(document.getElementById(name + '-mode'));
angular.bootstrap(root, [function($compileProvider, $locationProvider, $provide){
- $locationProvider.html5Mode = true;
- $locationProvider.hashPrefix = '!';
-
+ $locationProvider.html5Mode(true).hashPrefix('!');
+
$provide.value('$browser', browsers[name]);
$provide.value('$document', root);
$provide.value('$sniffer', {history: name == 'html5'});
--
cgit v1.2.3