`If my path URL is https://example.in/home/page1 I expect it to be https://example.in/iuwrhwie%62jwef
I tried encodeURIComponent
name = encodeURIComponent("engine & machinery");
url = `/project/${encodeURIComponent('R&D Some Other Text')}`;
dashboardUrl = '/dashboard/?isopen=true&name=' + name;
2
Answers
Try with CryptoJS
here is the example code, you may use according to your requirements.
1st one is by simple one with no special encoding
2nd one is use special encodeURIComponent or decodeURIComponent
To Print Output in our screen , we add variables in ‘app.component.html’ file:
https://codesandbox.io/p/devbox/confident-oskar-hwr3wr?file=%2Fsrc%2Fapp%2Fapp.component.ts%3A7%2C38