i have this routing code on my app:
var app = angular.module('docFinder', [])
app.config(function($routeProvider){
$routeProvider.
when('/',
{
controller: docTable,
templateUrl: 'partials/finder.html'
}).
when('bio/:finderId',
{
controller: bioCtrl,
templateUrl: 'partials/bio.html'
}).
otherwise({redirectTo: '/'});
});
when i start my app and go to root y click on a link to the second route
once i get there i hit the back button on my browser and it dosn't goes back it only refreshes my current page, any ideas on the problem?
EDIT:
Solution
<tr ng-repeat="doc in providers" ng-mouseover="mouseOverDoc(doc)" ng-mouseleave="mouseLeave()">
<td><a href="#bio/{{doc.provider.Id}}"> {{doc.provider.FirstName}} </a></td>
</tr>
Use #/ on link. it seems bug on angular js. for example:
<td><a href="#/bio/{{doc.provider.Id}}"> {{doc.provider.FirstName}} </a></td>
It doesn't seem to be a bug to me.
AngularJS provides two configuration modes for $location service to control the format of the URL in the browser's address bar.
This can be resolved if you set the configuration to HTML5 Mode
using { html5Mode: true }
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With