HabPanel and Angular compatibility

Because HABpanel uses angular, i tought the number decimal pipe should be available. But somehow i can’t get it to work.

This number item that stores value’s with 3 digits. Say 123.456 I would like this to be 123.45 in HABpanel .

According to the angular documentation this should work:
{{itemState(‘verd0_meterkast_stroom_huidig’) | number:‘1.2-2’}}

But as soon as i use the ‘1.2-2’ the template string is shown instead of the number. Maybe i have to escape the ’ ? but how?

@ysc could you point me in the right direction? I think it has something to do with the escaping of the format string.

Ah got it fixed. Habpanel uses angularjs (1.5.11) That version supports a different fraction string: https://docs.angularjs.org/api/ng/filter/number (angularjs most recent version is 1.7.2 by the way. )

While i was looking at the most recent angular version 6.1.2 : https://angular.io/api/common/DecimalPipe

Would it be possible to upgrade habpanel to most recent angular version?

That would be a massive re-write, as Angular 6 bears no relationship to 1.X. Trust me, I’m in the throws of learning 6 :slight_smile:

I agree. There is not even an upgrade guide from AngularJS to Angular. https://update.angular.io/ As @evansnp said: It is massive and the angular team makes no secret of it: https://angular.io/guide/upgrade

I gladly contribute to one module if someone comes up with a battle strategy.

A battle strategy would really be appreciated. I can think of some steps, but it all depends on how habpanel is put together. We could look at the HABpanel source code how it is put together, but it would greatly help if there is some documentation.