Sunday, 8 September 2013

Issue using the Angularjs $location provider and ASP.NET MVC action links together

Issue using the Angularjs $location provider and ASP.NET MVC action links
together

I have an application that uses both ASP.NET MVC and Angularjs. I'm using
the Angularjs $location provider to modify the search part of the url when
filters are added or removed.
$location.search(searchObj);
I am then subscribing to the $locationChangeSuccess event and using
signalr to update the data on the page without requiring an asp.net post
each time a filter is changed.
$scope.$on('$locationChangeSuccess', onRouteChanged, false);
All of the above works, however, I also have some mvc action links on the
page that I need to work when clicked.
<a href="@(Url.Action("Details", "Video"))/{{item.id}}">
...
</a>
Unfortunately, when clicking those links, the url is updated but the mvc
post doesn't happen. If anyone knows how to make this work I would be
grateful.

No comments:

Post a Comment