I want to remove the #
on angularjs url. So I followed this blog.
This is my .config()
:
.config(['$stateProvider', '$locationProvider' function($stateProvider, $locationProvider,) {
$stateProvider.state('main', {
url: '/',
templateUrl: 'path/to/main.html',
controller:'mainCtrl'
})
$locationProvider.html5Mode(true);
}])
And this is my <header>
:
<head>
<scripts>....
<base href="/"> // I ADDED THIS
</head>
But when I access the /
link. Like this http://localhost/my-app/
it only shows a blank page. There are no error/s on the console so Im assuming that the problem is on the loading of the template. Im using ui.router
. Someone encountered this problem? Thanks.