1

I'd like to be able to catch any link in my site that starts with "/@" and handle with a full browser reload.

Something like:

$locationProvider.html5Mode(true)
$routeProvider.when("/@:id",
  # window.location.href = [the link's url]
  # all others are handled by typical controller/view

I have been able to solve the problem using an attribute/directive on an anchor tag, but I'd like to do this at the url routing level.

dnewman
  • 275
  • 3
  • 11
  • That's not really the answer to your question, but you could add `target="_self"` to your links as suggested in http://stackoverflow.com/a/19257277/2248275 – Nicolas Cortot Nov 22 '13 at 15:29

1 Answers1

0

I'm not sure if it's the best solution, but you can set a parameter based on current time instead of the '/@' code

e.g.

<a href="/Customer/Edit/{{customer.id}}&refresh={{now}}">{{customer.Name}}</a>

where 'now' is set on $rootScope after each $routeChangeSuccess

$rootScope.$on('$routeChangeSuccess', function (event, current, previous) {
$rootScope.now = Date.now();
});

This might be improved but it's working.

You might also have a look to angularjs - refresh when clicked on link with actual url

Community
  • 1
  • 1