How to specify replace url option in router link angular html template

Viewed 1957
 <button color="dark" fill="outline"  [routerLink]="['/home']" size="medium"
          >Click here to add some</button>

how should I pass replace URL option just like we do in the TS file

 await this.router.navigate(['/profile'], { replaceUrl: true });
2 Answers

I found it myself by seeing type file of angular routing :) here is how I do it

<button color="dark" fill="outline" replaceUrl="true"   routerLink="['/home']" size="medium"
              >Click here to add some</button>
<button replaceUrl="true" routerLink="/home">Click here to add some</button>

You dont have to use [] for replaceUrl and routerLink if those are not bound but simple values.

Related