I am currently working on implementing ui-router in my Angular application.
The base URL I am using is "/segments" and I have defined it using the base tag.
<base href="/segments" />
Below is my routing configuration:
var base = "/segments"
$stateProvider
.state('list', {
url: base,
controller: 'FilterLestCtrl',
templateUrl: '/segments/partial?partial=list'
})
.state('new', {
url: base + '/new',
data: {
mode: 'new'
},
controller: 'SegmentFormCtrl',
templateUrl: '/segments/partial?partial=edit'
})
.state('edit', {
url: base + '/:id/edit',
data: {
mode: 'edit'
},
controller: 'SegmentFormCtrl',
templateUrl: '/segments/partial?partial=edit'
});
$locationProvider.html5Mode(true).hashPrefix('!');
After clicking on a link tag, I noticed that I cannot navigate to other resources on my site. For example, when I click on:
<a class="" href="/widgets">Widgets</a>
The URL changes but nothing happens.
Question: How can I properly handle external links to other pages on the site while using ui-router?