diff --git a/client/Nightr/src/app/services/my-battery-info.service.ts b/client/Nightr/src/app/services/my-battery-info.service.ts new file mode 100644 index 0000000..c00a32d --- /dev/null +++ b/client/Nightr/src/app/services/my-battery-info.service.ts @@ -0,0 +1,15 @@ +import { Injectable } from '@angular/core'; +import * as power from 'nativescript-powerinfo' + +@Injectable({ + providedIn: 'root' +}) +export class MyBatteryInfoService { + + constructor() { } + public getPowerPercent (): number { + power.startPowerUpdates(function(Info) { + power.stopPowerUpdates(); + return Info.percentage; + }) +} diff --git a/client/Nightr/src/app/services/my-http-post-service.ts b/client/Nightr/src/app/services/my-http-post-service.ts index 8dca261..69202bf 100644 --- a/client/Nightr/src/app/services/my-http-post-service.ts +++ b/client/Nightr/src/app/services/my-http-post-service.ts @@ -10,7 +10,6 @@ export class MyHttpPostService { constructor(private http: HttpClient) { } postData(data: any) { - console.log('logged data is', data); let options = this.createRequestOptions(); return this.http.post(this.serverUrl, { data }, { headers: options }); }