I am working on an Angular app that consists of both AngularJS and plain JavaScript such as Ajax. I am trying to figure out how to use $location within a function without passing it as a parameter.
function x() {
$location.path('/error').replace();
}
My current challenge is finding a way to utilize $location
within a regular JavaScript function. This function is called from multiple places in the app and I need to implement replacestate within it.