Many Angular directives utilize dot notation options:
style.padding.px
style.padding.%
attr.src
In addition, libraries like flex-layout employ this for various responsive sizes:
fxLayout.gt-sm
fxAlign.sm
Can the same concept be applied to a component's @Input
?
If not, how do other developers achieve this? Do they create unique inputs for each possible option like this:
@Input('style.padding.px') paddingPx
@Input('style.padding.%') paddingPercent
...
EDIT
Here is a scenario I am looking at:
I want to either 'catch all' or dynamically add more @Input()
's.
For example, if I have a @Input('size')
option.. I would like to be able to include size.sm
, size.md
etc., which, in this case, would be taken from flex-layout's custom breakpoints list.