I want to create a monthly calender widget for my wall-mounted tablet.
Does anybody of you already implemented such a widget?
I found a calendar for angular/javascript which looks quite nice, called âng-fullcalendarâ (âhttps://www.npmjs.com/package/ng-fullcalendarâ). What I understood is it could actually also create entries, not just displaying the days and events.
I thought because of the ângâ in the name itâs as simple to implement as the other Angular bootstrap widgets available, but sadly I wasnât able to integrate it yet.
I tried to put the code in .js files, tried it also with app.component.ts and app.module.ts, all loaded via the lazy-load command, but I didnât manged it.
Any ideas how that could be implemented?
Sorry I canât help, not an expert in angular by any means. What happens in the code you posted? Are the items sorted at all? Are they limited to 5?
The syntax seems correct to me, but again, not an expert.
Thanks, that did get me a step further. I got this now:
<div class="row" ng-repeat="item in itemsInGroup('gEnergyCons') | orderBy:'state':reverse | limitTo: 5">
Now it does order by item state, however they have a numerical value, but the orderBy sorts by the textual representation. So for example 90 > 100. Not what I want of course.
Also the reversing doesnât work.
Donât have more time now to play with it.
Hello again,
once more I have come to a problem. I would like to make this widget abit more interactive, so i added a ng-init. It woks fine on the dashboard but i can not get it to work on the widget-icon. Does anyone have an idea how to get that working?
A follow-up on my problem with displaying several items ordered by their state as a number. It took me quite some trial error and searching, but I finally came to a solution.
It seemed I couldnât get around defining a sorter function to convert the state to a number. But this needs to be done in a separate js file, which you have to put in conf/html. So I created a file there named widgetcontroller.js with these contents:
Ok, look like i could understand this code?
You give a group of items into the sorter javascript and as item.state result you get a 0 or 1.
The orderBy uses the script via sorterFunc and the number of items will limit to a maximum of 5.
hope that i am right till this
All OFF items get the same 0 as return value, all ON items the 1 and this will send to the item.name variable? Could not even see a sort function only the calculation with a .name item?? or did i missing something?
The item state is a number, not an ON or OFF; it contains a value for the electrical current.
itemValue(item.name) gets the value of the item by passing the item.name to the itemValue() function. Then I multiply with a voltage to get the power consumption. The division by 1000 is because the current value is in milliamperes and I want my result in watts, not milliwatts.
Hmm, try to make a easy grid, but it seems the array is build randomly in the sorting.
In the things i defined:
Group gAvtivities "AktivitÀt"
Group gLocations "Standorte"
Group gCol_01 "Licht" <'bulb'> (gActivities)
Group gCol_02 "Video" <'tv'> (gActivities)
Group gCol_03 "Audio" <'speaker'> (gActivities)
Group gRow_01 "Kueche" <'kitchen'> (gLocations)
Group gRow_02 "Flur" <'wardrobe'> (gLocations)
Group gRow_03 "Schlafzimmer" <'sleep'> (gLocations)
Group gRow_04 "Bad" <'bath'> (gLocations)
if i start the widget i get a different order sometimes⊠can i define a sort order for the itemsInGroup
<div class="row">
<div class="col-xs-1"></div>
<div class="col-xs-1" ng-repeat="group in itemsInGroup('gActivities')">{{group.label}} {{group.name}}</div>
</div>
<div class="row text-left bg-primary" ng-repeat="group in itemsInGroup('gLocations')">{{group.label}} {{group.name}}</div>
Hey everyone!
I used the Search but couldnt find a solution for my Problem, maybe one of you can help me.
Currently i am creating a new Dashboard for my SmartHome Project, with some UI for Heating, Lights, Shutters etc. I am using the new-pride-theme which is based on the almost legendary Matrix Theme