Comitting before pulling Picture service
This commit is contained in:
parent
b7d7cbcdb3
commit
57352c3763
15
client/Nightr/src/app/services/my-battery-info.service.ts
Normal file
15
client/Nightr/src/app/services/my-battery-info.service.ts
Normal file
|
@ -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;
|
||||||
|
})
|
||||||
|
}
|
|
@ -10,7 +10,6 @@ export class MyHttpPostService {
|
||||||
constructor(private http: HttpClient) { }
|
constructor(private http: HttpClient) { }
|
||||||
|
|
||||||
postData(data: any) {
|
postData(data: any) {
|
||||||
console.log('logged data is', data);
|
|
||||||
let options = this.createRequestOptions();
|
let options = this.createRequestOptions();
|
||||||
return this.http.post(this.serverUrl, { data }, { headers: options });
|
return this.http.post(this.serverUrl, { data }, { headers: options });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user