lucca-front icon indicating copy to clipboard operation
lucca-front copied to clipboard

TooltipTriggerDirective: change inputs for models

Open Ptit-Biscuit opened this issue 1 year ago • 3 comments

Description

Change inputs for models to set properties from outside.


Th goal is to be able to set luTooltip, luTooltipDisabled etc directly within a .ts file. E.g. on T.Abs we have a translateI18n directive that adds a tooltip on host so we want to set it within ngOnInit.


Ptit-Biscuit avatar Dec 11 '24 08:12 Ptit-Biscuit

:woman_cook: https://lucca-front.lucca.tech/PR-3281/storybook

LuccaIntegration avatar Dec 11 '24 08:12 LuccaIntegration

@GuillaumeNury I was thinking about this yesertday and I thought: what about using linkedSignals for input overrides?

Something like:

luTooltip = input<PortalContent>();

tooltipContent = linkedSignal(() => this.luTooltip());

This would allow overriding the value from any component using this as hostDirective without using a model, additionally, with a proper naming convention, we could make it easy to use for most devs.

However, it wouldn't fix the issue with required imports, but that's on Angular.

Supamiu avatar Dec 11 '24 12:12 Supamiu

I like the idea of linkedSIgnal!

GuillaumeNury avatar Dec 11 '24 13:12 GuillaumeNury