I have a dashboard and skills components and I am trying to pass the type from dashboard to be used in skills. However, I am encountering an error stating it is undefined.
Dashboard Component:
export class DashboardComponent implements OnInit {
type: string;
constructor() { }
ngOnInit() {
this.type = "Agent";
}
The Skills component is as follows:
export class SkillComponent implements OnInit{
@Input() type: string;
constructor() { }
ngOnInit() {
console.log(this.type);
}
Dashboard component template:
<div class="container">
<div class="row">
<app-skill-list [type]="type"></app-skill-list>
</div>
</div>