From 57352c3763c09d21fb3a27d309f250b80ff00bc7 Mon Sep 17 00:00:00 2001 From: Whizel Date: Sat, 6 Apr 2019 20:39:28 +0200 Subject: [PATCH] Comitting before pulling Picture service --- .../src/app/services/my-battery-info.service.ts | 15 +++++++++++++++ .../src/app/services/my-http-post-service.ts | 1 - 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 client/Nightr/src/app/services/my-battery-info.service.ts 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 }); }