A
A
anriko2021-11-19 11:49:14
Angular
anriko, 2021-11-19 11:49:14

How to correctly write styles in ngStyle in Angular?

i do it but error

[ngStyle]="{'backgrounImage':'url(' +url +')', 'backgrounPosition': offsetX + 'px'  offsetY + 'px', 'windth': windth + 'px', 'height':height + 'px' }"

error NG5002: Parser Error: Missing expected } at column 74 in [{'backgrounImage':'url(' +url +')', 'backgrounPosition': offsetX + 'px'  offsetY + 'px', 'windth': windth + 'px', 'height':height + 'px' }] in C:\Users\Anriko\Desktop\angular-home-work\my-app\src\app\[email protected]:40

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Shvets, 2021-11-19
@Xuxicheta

backgroun d Image
In general, I recommend describing styles in this way, it reads better
https://stackblitz.com/edit/angular-ivy-3nwfzl?fil...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question