I have an Angular Ionic Application in that application I use angular-calendar. I set the background color of the Month-view Day field in my Html file like this:
[ngStyle]="this.isAbsent(day.date) && {'backgroundColor':'#'+this.getColor(day.date), 'opacity': this.getOpacity(day.date)} || null"
which works like its supposed to in the WebApp but in Android Studio the background color stays white.
Also for the sake of completion here is my Code that returns the Colorstring:
getColor(date: Date) : string
{
let retString;
if(this.absentTime.some(item => item.start === date.valueOf()))
{
retString = this.absentTime.find(item => item.start === date.valueOf())!.color
if(retString === 'ffffff') //if codecolor is white it would not differentiate from not absent Days
{
retString = 'ff3131';
}
}
else
{
retString = 'ffffff'
}
return retString;
}
I have had a suspicion that somehow the condition is false but when I changed null to
{'backgroundColor':'#000000'}
The Background was still white (should be black if condition fails).
The Green one is from my WebApp the white one from android Studio. They are the same size I just suck at cropping Pictures.
What I tried: I debugged my API to make sure I get all the Data which is the case.
I could not find anything about *ngStyle not working properly when compiled to android.
Also I find it hard to belive that *ngStyle is at fault because I use it at several other Points in my Application where it works just fine both in android Studio and the WebApp.
Logcat in Android Studio does not show any errors.
What causes this? Is it possible that my custom Template doesn't get taken in to account in the android build but in my WebApp build it does?
Any Help or Ideas are appreciated.
Ps: changing null to {'backgroundColor':'#000000'} should change all the backgrounds to black if the condition is false(majority of the time) and it does but only in the Webapp.