I am setting up a scaffold for an app I'm building with angular and angular-ui-routes. I have them working however it seems to be adding a hash onto my url like (I'm localhost for dev right now ) localhost:9000/#/test. When I land on the main page it's just localhost:9000 and it still serves the main view content. I would like to get rid of the has if possible.
so here is my setup -
in my index.html in the body I just have my nav and then view under that
<div class="row">
<ul class="nav navbar-nav">
<li><a ui-sref="index">Home</a></li>
<li><a ui-sref="test">Test</a></li>
</ul>
</div>
<div ui-view=""></div>
and in my app.js I just have -
angular
.module('playApp', [
'ui.router'
])
.config(function($stateProvider) {
$stateProvider
.state('index', {
url: '',
templateUrl: 'views/main.html',
controller: 'MainCtrl'
})
.state('test', {
url: '/test',
templateUrl: 'views/test.html',
controller: 'testCtrl'
});
});
So when I land, it's fine, but when I start using the nav I have set up, it adds the hashes to the url, would prefer not to have them if possible. Thanks!
$locationProvider
and do$locationProvider.html5Mode(true);
– Callum Linington Feb 27 '15 at 15:24