Let's say I have a very basic component that adds functionality to a given text. For example:
@Component({
selector: 'app-clickable-key',
template: '<span (click)="doSomething()">{{ key }}</span>',
styleUrls: ['./translated-text.component.scss']
})
export class TranslatedTextComponent {
@Input() key: string;
doSomething(): void {
this.key = `${this.key} clicked!`;
}
}
Usage would be:
<app-clickable-key key="Hello!"></app-clickable-key>
Now I would like to append the above functionality not only to tree nodes but also to attribute values:
<3rd-party-input customLabel="How to make this clickable as well?"></3rd-party-input>
...Which is essentially just a wrapper of a label (<label>{{ customLabel }}</label>)
If this functionality was only for a transformation of the text, then I would be able to use pipes, but in this case, I need to change the template of that placeholder. Is that somehow possible?