1

I have a routerLink like this in my html page.

[routerLink]="['/sales/hotels', hotels[0].code]

And I am getting this id to my component like this.

 ngOnInit() {
    this.getId();
  }
     getId() {
        this.route.params.subscribe( params => {
          console.log(params.id);
        });
      } 

This is my Url.

http://localhost:8000/sales/hotels/56749547

I want to hide this hotels[0].code id passed in the url or hashing it for protection.I tried to hide it using [skipLocationChange]="true" in roterlink.but it didn't work. What can i do with it?

Hans
  • 308
  • 7
  • 20
  • For protection from what ? It's already on the client side, so you cannot protect it from anything, either obfuscate it on server side before you send the response or just use the id as it is. – cyr_x Jun 30 '20 at 07:52
  • Normally we are not just passing the id 's in URLs.or can i hide it? – Hans Jun 30 '20 at 07:54

0 Answers0