0

Long story short in my app the user receives an email notification which has hyperlink to open a certain record for a given id number. It looks something like this:

https://myappserver.com/?aid=12343551

The question I have is once the user opens the record is it possible to change the URL through ionic? I would like to change the url after opening and remove the parameter so it looks like this https://myappserver.com/

I can retrieve the URL through this.platform.url() but I don’t know how to change it.

2 Answers 2

4

You can use Location from @angular/common. Then you can use it like: this.location.replaceState('/'). Here is the reference.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks worked but I had to change the URL myappserver.com/#/?aid=12343551 no biggie
0

You could use the history function of the window object

window.history.pushState('', '', '/');

Which don't rely on Angular.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.