#Flexible string types and auto suggestion

12 messages · Page 1 of 1 (latest)

meager hedge
#

I'm trying to get suggestions for values to pass to an input property. I want to be able to pass in primary-btn small or large secondary-btn basically any variation. But i want to get the suggestion after tapping a spacebar so I see the next potential value that can be passed.
What I have below only allows either of the strings. Please how can achieve what I want

@Input() customClass: 'primary-btn'|'secondary-btn'|'small'|'large';
<button [ngClass]="customClass"></button>
#

Flexible string types and auto suggestion

rotund canopy
#
@Input() customClass: 'primary-btn small' | 'secondary-btn small' | 'primary-btn large' | 'secondary-btn large';
meager hedge
rotund canopy
meager hedge
meager hedge
rotund canopy
#

If it compiles, then IntelliJ is wrong (but it doesn't complain here)

barren flume
#

You probably used colon : in place of equal = sign when defining ButtonStyle on first line.

meager hedge
meager hedge
#

Wrote it all manually 🥲