I want to change the element class when the page changes and use the location.path () file or something to capture the corresponding fragment of the url.
I use $ routeProvider for routing. The violin does not show it properly, but it works fine in my code. The problem I am facing is that it does not update when the next page loads.
This code picks up the url fragment that I want:
$scope.locationPath = $location.path().replace(/^\/([^\/]*).*$/, '$1');
Here is a very simple JSfiddle: http://jsfiddle.net/timothybone/kmBXv/1/
angularjs
spracketchip Nov 20 '12 at 2:21 2012-11-20 02:21
source share