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
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.