I am struggling with adding a custom filter to a Matrix theme based HABpanel widget.
When adding the lazy-loaded filter directly to the <div>
using it, it works. But that way I have to add it every time I need the filter.
<div class="value">
<div class="main" oc-lazy-load="['/static/js/floor.js']">{{itemValue('Power_Delta_All_Current')/1000 | floor}}</div>
<div class="decimals">.{{(itemValue('Power_Delta_All_Current')/1000 | number:1).split('.')[1]}}</div>
<div class="sub">kW</div>
</div>
If I add it at the top (after jsquery is loaded), it doesn’t work.
<div oc-lazy-load="['/static/matrix-theme/jquery-3.2.1.min.js','/static/matrix-theme/matrix.js']"></div>
Error in Chrome console:
[$injector:unpr] http://errors.angularjs.org/1.5.11/$injector/unpr?p0=floorFilterProvider%20%3C-%20floorFilter
What is the correct way to deal with AgularJS in HABpanel widgets?