Any particular reason you chose $window over $location.path()?