Maybe it's something simple, but this is the first time I'm using the angular-ui-router. I'm using html5 mode and I've got the following states configured:
$locationProvider.html5Mode(true);
$authProvider.loginUrl = API_LOCATION + 'authenticate';
$urlRouterProvider.otherwise('/auth');
$stateProvider
.state('auth', {
url: '/auth',
templateUrl: TEMPLATES_LOCATION + 'login.html',
controller: 'AuthController as auth'
})
.state('country', {
url: '/country',
templateUrl: TEMPLATES_LOCATION + 'country.index.html',
controller: 'CountryListController'
})
.state('country.select', {
url: '/select',
templateUrl: TEMPLATES_LOCATION + 'country.select.html',
controller: 'CountrySelectController'
})
.state('country.edit', {
url: '/:isoCode',
templateUrl: TEMPLATES_LOCATION + 'country.edit.html',
controller: 'CountryEditController'
});
All country routes load country.index.html
and CountryEditController
. Why?
EDIT
my .htaccess file (the angular app is in a subfolder named "admin")
RewriteEngine on
#RewriteBase /admin/ <- tried this too
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(.*) /admin/index.html [NC,L]
MYSITEURL/#/country
?<a ui-sref="country">Country Link</a>
it will work