S
S
Sasha_beg2019-09-08 14:42:45
Angular
Sasha_beg, 2019-09-08 14:42:45

How to set formula for angular block height?

guys, tell me please. How to set the formula for block height? The formula is already there, but I don’t know where and how to prescribe it

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
grinat, 2019-09-08
@grinat

Somewhere in the styles I suspect.

P
Pavel Pikat, 2019-09-08
@PavelPikat

In the template: <div [style.height.px]="blockHeight"></div>
where blockHeightis the component variable. Of
course, you can use the whole function in the template, [style.height.px]="calculateHeight()"like the function will be called every time a change detection occurs. It is better then to make a pipe that will calculate the value from some initial value, or make a directive that will set the height for the blocks.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question