wag2639
wag2639

Reputation: 2583

Replace history and then redirect in AngularJS

While trying to access window.location or window.history directly, how can I do the following in AngularJS:

  1. Replace the history for current location
  2. Redirect to a new location

For example:

Upvotes: 8

Views: 7595

Answers (1)

ivarni
ivarni

Reputation: 17878

Is this what you want?

$location.path('/blahblah').replace();

See API Docs for $location

Upvotes: 11

Related Questions