0

I would like to pass my component property values to inline css.

<div [ngStyle]="{ 'width': '{{ object.value }}%' }">

The method is not working and getting error:-

 Parser Error: Got interpolation ({{}}) where expression was expected
mevr
  • 1,075
  • 3
  • 14
  • 32

1 Answers1

1

Your syntax is wrong. Use one of below syntax

[style.width.%]="object.value"

Or

[ngStyle]="{ 'width.%': object.value }"
navnath
  • 3,548
  • 1
  • 11
  • 19