I have an array of values var_all
with a few numeric variables which may or may not be available.
I am using the following code to create a set of boxes displaying the values. The boxes does not change:
<div id="box1">My variable one: {{var_all?.var_one}} </div>
<div id="box2">My variable two: {{var_all?.var_two}} </div>
<div id="box3">My variable three: {{var_all?.var_three}} </div>
When the element is not available, the box is not filled.
I would like in that case to display a zero value instead of nothing.
Is there a way to do it using pipe? Or is it better to use a js function to create an element filled with a zero.