How can I implement a redirect from clicking on the "Firms" word to another component page in Angular? I have tried using routerLink="/", [routerLink]="['/']". I have imported Routes in the app.module. I have also attempted this approach:
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.css']
})
export class HomeComponent implements OnInit {
constructor(private router: Router) {}
ngOnInit(): void {
this.router.navigate(['/insights']);
}
}
This is my code:
<div class="container">
<div class="row">
<div class="col-12">
<div class="list-group">
<div class="list-group-item" *ngFor="let firm of firms | async">
{{ firm.hash }} - {{ firm.name }}
</div>
<div class="list-group-item">
<a href="http://google.com">
Create new
</a>
</div>
</div>
</div>
</div>
</div>