I am using Angular 9 together with ionic5 and I need to get the currently used mode (string md
or ios
which can be different from platform) from my typescript code. So my question is that if this is possible directly from typescript code without the need of reading it from the tag html mode
attribute.
I tried to consult the official documentation on Platform styles, but this only considers usage inside CSS.
mode="{{YourModeVariable}}"
from your ts. and inside yourts
you can defined which one to useYourModeVariable = 'md | ios';
then you will know which mode you are using and change is dynamically.IonicModule.forRoot({mode:'md'}),
insideapp.module.ts
,this.platform.platforms()
still returns[ "iphone", "ios", "mobile", "mobileweb" ]
.