[SOLVED] Dynamic values in formula

Hello,
i would like to convert This working formular to a dynamic widget but i can’t find a working solution

<button ng-click="sendCmd(config.timer_raum, +itemValue(config.timer_raum) + 1 > 15 ? 15 : +itemValue(config.timer_raum) +  1)">
<i class="glyphicon glyphicon-menu-up"></i>
</button>

In my widget i have defined two Number fields with min_max and min_step if i now change the code to:

<button ng-click="sendCmd(config.timer_raum, +itemValue(config.timer_raum) + {{config.min_step}} > {{config.min_max}} ? {{config.min_max}} : +itemValue(config.timer_raum) +  {{config.min_step}})">
<i class="glyphicon glyphicon-menu-up"></i>
</button>

This don’t not work I can see in the Source code of the Page that the values replaced are correct but the button does not work. I have tried some other examples from AngularJS but it seems i’m to blind to find the right solution for this problem.

can someone push me please in the right direction

Andy

@rlkoshak is usually good at pushing people in the right direction :smiley:

Sadly, I don’t know much about HABpanel custom widgets.

1 Like

You have to remove the {{ }}, since you are already inside an expression i.e. the entire ng-click is already a “dynamic value”, the double curly braces are only for places when a literal value is expected.

1 Like

oh man so easy :thinking: !!! thank you !!!