Having some issues with links in my page in my angular application.
So just quick overview :
I have html 5 mode turned off
here is my routing set up
$routeProvider .when('/',{ templateUrl: '/views/search.html', controller : 'SearchCtrl' }) .when('/result',{ templateUrl: '/views/result.html', controller : 'resultCtrl' }) .when('/no-result',{ templateUrl: '/views/no-result.html', controller : 'noResultCtrl' }) .otherwise({ redirectTo: '/' });$locationProvider.html5Mode(false);
The issue I found is the behaviour of the url
- If I just type in my domain, the page loads fine to the following url
Domain/# and the view loads correctly and loads the controller as well
- But then lets say I have a a href in my page I want to link back to homepage
As follows
<a ng-href="/" class="link-dark">Link </a>
it changes the url to Domain/# but the view and controller do not load.
but if I change the url to
<a ng-href="/#/" class="link-dark">Link </a>
it loads correctly.
Is this normal behaviour something just seems off ?
hrefsshould be<a href="#/">and thewhenshould be like.when('/',{