Shankar_programmer
Shankar_programmer

Reputation: 308

Need to hide the variable values in the url

We had build a website using angular js, html and php. When passing the values between the two pages using state params in angular js. The values are visible in url like below.

/app/create_addpos/update/9486904359/1820

We don't need to show the real values in url while passing to different page. I don't how to get this. Please help me to acheive.

Upvotes: 0

Views: 92

Answers (1)

I am L
I am L

Reputation: 4632

I don't think there is a way to "hide" the values on the url, what you can do is once the page "mounted", replace the url by a fake "display url".

by doing this (so the page doesn't get refreshed/redirect):

so if you redirect to: /app/create_addpos/update/9486904359/1820

you can change this to:

window.history.pushState("", "", '/app/create_addpos/update/'); // or some other url

Do this on the /app/create_addpos/update/9486904359/1820 page.

Upvotes: 1

Related Questions