Willem Dantuma 8aafeccea6
Some checks failed
FarmMaps.Develop/FarmMapsLib/develop There was a failure building this commit
Add common-map library
2019-10-28 14:18:25 +01:00

35 lines
1.4 KiB
TypeScript

import { Observable, of } from 'rxjs';
import { Component, OnInit } from '@angular/core';
import { Input, Injectable } from '@angular/core';
import { Store } from '@ngrx/store';
import * as mapReducers from '../../reducers/map.reducer';
import { commonReducers, ItemTypeService, IItem, Item, ItemService, IListItem } from '@farmmaps/common';
import { ForItemType } from '../for-item/for-itemtype.decorator';
import { ForSourceTask } from '../for-item/for-sourcetask.decorator';
import { AbstractItemListItemComponent } from '../item-list-item/item-list-item.component'
import { Stage } from '../widget-status/widget-status.component';
@ForItemType("vnd.farmmaps.itemtype.watbal")
@ForSourceTask("vnd.farmmaps.task.watbal")
@Injectable()
@Component({
selector: 'item-list-item-watbal',
templateUrl: './item-list-item-watbal.component.html',
styleUrls: ['./item-list-item-watbal.component.css']
})
export class ItemListItemWatBalComponent extends AbstractItemListItemComponent implements OnInit {
@Input() item: IListItem;
TPVOCMET;
stage = Stage.DevelopmentPreAlpha;
constructor(store: Store<mapReducers.State | commonReducers.State>, itemTypeService: ItemTypeService, private itemService$: ItemService) {
super(store, itemTypeService);
}
ngOnInit() {
this.itemService$.getItem(this.item.code).subscribe(i => {
var data = i.data.HTAKKER_Input.TPVOCMET;
this.TPVOCMET = data[data.length - 1];
});
}
}