Add data layer
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Willem Dantuma
2020-06-29 15:44:23 +02:00
parent 0d247e6416
commit 0b7564e874
8 changed files with 50 additions and 82 deletions

View File

@@ -0,0 +1,21 @@
import { Injectable } from '@angular/core';
import { IJsonline } from '../models/json-line';
import { ISenMLItem } from '../models/senml-item';
@Injectable({
providedIn: 'root',
})
export class SenmlService {
constructor() {
}
getSenMLItem(name:string,jsonLine:IJsonline): ISenMLItem {
if (jsonLine) {
var senmlPack = jsonLine.data as ISenMLItem[];
var temp = senmlPack.filter((i) => i.u == name);
if (temp.length == 1) return temp[0];
return null;
}
}
}