When using the ngStyle directive, remember to pass the styles as a JSON object with keys as style names and values as CSS attribute values.
[ngStyle] = "{ 'height': events?.length === 0 ? 'calc(100vh - 105px)' : null }"
In your code snippet,
[ngStyle]="{'height: calc(100vh - 105px)': events?.length === 0 }"
You have incorrectly used the full [style name]: [style value] as the key in the JSON data which will not work with ngStyle.
The correct usage of [style.height] is to set the height CSS attribute within the style HTML attribute.
For example,
[style.height]="'100px'"
has the same meaning as
style="height: 100px;"
.
In this piece of code,
[style.height]="{'calc(100vh - 105px)': events?.length === 0 }"
You've placed a JSON object into style.height which is not valid for setting the height CSS attribute value.