Issue
I created a modal, when the user clicks on confirm
, I would like the user to be redirected to the page => securities-in-portfolio
.
<div class="modal-footer justify-content-center">
<button type="button" class="btn btn-primary" (click)="confirm()">
Confirm
</button>
</div>
Do you know how to write this in TS, please?
Solution
Yep. in your component file.
You have to have a method named confirm. it looks like:
constructor(private readonly router: Router // -> add this) {}
confirm() {
this.router.navigateByUrl('/ROUTE_TO_SECURITIES_IN_PORTFOLIO');
}
Answered By – Anh Le
Answer Checked By – Willingham (AngularFixing Volunteer)