How can I show a component input property in the view?
I have attempted various methods, but none of them seem to be working as expected. Reference:
Component implementation:
<card [title]='My Awesome Card'></card>
Template section:
<div class="ui card">
<div class="content">
<div class="header">{{ title }}</div>
</div>
</div>
Snippet of the component setup:
@Component({
selector: 'card',
templateUrl: './card.component.html'
})
export class CardComponent implements OnInit {
private _title: string;
get title(): string {
return this._title;
}
@Input()
set title(title: string) {
console.log('Previous value: ', this._title);
console.log('New title received: ', title);
this._title = title;
}
...