Hi All,
I am currently applying the battery status in ionic… But I always get errors…
What’s the best tutorial that I can use, that will really work.
Hoping for your positive response.
Thank you.
Hi All,
I am currently applying the battery status in ionic… But I always get errors…
What’s the best tutorial that I can use, that will really work.
Hoping for your positive response.
Thank you.
@rapropos Thanks for the reply…
I have already imported BatteryStatus in my app.module.ts but still got the same error.
@NgModule({
...
providers: [
...
BatteryStatus
...
]
...
})
Yes, like this
providers: [
{provide: ErrorHandler, useClass: IonicErrorHandler}, BatteryStatus
]
Great!
2 things:
Okay @MattE … but I my problem now is getting the battery status.
I used this tutorial…
but it says that :::
… I really don’t know about this because I’m new to this ionic thing.
What will I do now??
If you’re using the code from the docs (which you can find over here), and doing everything as stated over there, you could always try and change the type of status from StatusObject to any. Simply because of what you’re compiler is telling you (that it doesn’t know the type statusobject).
I’m not sure, but I guess you have to import StatusObject at the top, next to the import of BatteryStatus
Yes. If you want to use StatusObject as a type, you should import it, probably at the top of the page.
Thank you very much @MattE:blush: and @luukschoen:blush:
You’re really a big help.
Now, I can continue doing my app.