Using $location.search() to store the path in the location URL