Are the latest versions of angular/angular-route 1.6.1 set to use hashbang by default? It's interesting because, in this code snippet, I found that I have to use #! when linking to partials as #/ or #/partial2 doesn't seem to work. I was under the impression that a hash prefix had to be set manually but it seems like it's the default behavior:
<!DOCTYPE html>
<html ng-app='myApp'>
<head>
<title></title>
<script src="bower_components/angular/angular.min.js"></script>
<script src="bower_components/angular-route/angular-route.js"</script>
<script>
var myApp = angular.module('myApp', ['ngRoute']);
myApp.config(function ($routeProvider) {
$routeProvider
.when('/',{
templateUrl: 'partials/view1.html',
})
.when('/partial2',{
templateUrl: 'partials/view2.html'
})
.otherwise({
redirectTo: '/'
});
});
myApp.controller('view1Controller', function ($scope) {
$scope.sports = ['golf', 'basketball', 'hockey', 'tennis', 'football'];
});
myApp.controller('view2Controller', function ($scope) {
$scope.message = 'We are using another controller';
});
</script>
</head>
<body>
<div ng-app='myApp'>
<a href="#!/">Partial 1</a> | <a href="#!/partial2">Partial 2</a>
<div ng-view="">
</div>
</div>
</body>
</html>