I have parent component ParentComponent. Inside in this components template I have span element with MatBadge directive and my custom directive dir1
<span matBadge dir1 matBadgeColor="warn"></span>
I am trying to control Mat Badge content over my custom directive Dir1. My custom directive is connected to service
According to original documentation of AngularMaterial API, MatBadge directive has @Input (item | property) called content
As My Dir1 and MatBadge sharing same injector, I can inject MatBadge instance to my Dir1 class constructor.
constructor(
public badge:MatBadge,
)
Then I try to change the badge.content inside on my OnInit function of my Dir1 class
ngOnInit(): void {
this.badge.content="22"
}
... and nothing
But when I try to make same for badge.color, which is another @Input that MatBadge directive has, it works...
Help please!