$stateProvider
.state('admin', {
abstract: true,
url: '/admin',
template: '<div ui-view></div>'
})
<a ui-sref="admin">admin</a>
The url I get is <a href="/admin">admin</a>
when it should be /#/admin
-- this breaks when I command click on a link to open in a new tab.
This is a known issue, reported as a bug. Will be fixed in next release. Here is a workaround:
Impossible to disable html5Mode with angular 1.3.0-rc.3 #1397
Due to:
angular/angular.js@dc3de7f
the html5mode-check in urlRouter.js [line 383] is no longer correct. And thus it's impossible to disable html5mode.
A quick fix could be:
var isHtml5 = $locationProvider.html5Mode();
if (angular.isObject(isHtml5)) {
isHtml5 = isHtml5.enabled;
}
Also there is suggestion by Chris T (UI-Router
team member) - see comments under this Q & A
Use the pre-release version 0.2.12-pre1 for now. bit.ly/UIR-0212pre1 ... it has a few fixes for 1.3.0 compat. – Chris T Oct 16 at 16:13
Try to set the html5Mode
in $locationProvider:
$locationProvider.html5Mode(true);
Also, I found this issue, it may be related (I don't know which version you are using):
Impossible to disable html5Mode with angular 1.3.0-rc.3