Try to use $location.search to access url parameters