This has to be easy. Trying to input a string like 50%, 50px, 20rem ... as a width and then apply it to the html for the component.
<test title="frump" width="50%"></test>
export class test {
@Input() title: string;
@Input() width: string;
...
getWidth() {
return this.width;
}
<div [ngStyle]="{'width.px': 'getWidth()', ... or
<div [ngStyle]="{'width': 'width', ...
The width is being totally ignored... ? Thanks in advance.
<div [ngStyle]="{'width': width, ...or<div [style.width]="width".