Answer the question
In order to leave comments, you need to log in
How to fix Property 'includes' is missing in type error in angular 2?
Hello!
The following error comes out when compiling:
And here is my code:
chain.module.ts created interfaces
export interface EfficiencyOfAdditionalCostV1 {
ReportDate: Date;
ExtraProfitHour: number;
}
export interface EfficiencyOfAdditionalCostV4 {
ChangeBNPMonth: number;
ChangePPDay: number;
}
export interface EfficiencyOfAdditionalCostRes {
EfficiencyOfAdditionalCost_V1: EfficiencyOfAdditionalCostV1[],
EfficiencyOfAdditionalCost_V2: EfficiencyOfAdditionalCostV4[],
}
getEfficiencyOfAdditionalCostRes(): Promise<EfficiencyOfAdditionalCostRes> {
return this.http.get(this.api.API_URL + 'Production/EfficiencyOfAdditionalCost?counter=3')
.toPromise()
.then(res => res.json()[0]);
}
export class WidgetEfficiencyOfValueChainComponent extends WidgetComponent implements OnInit {
data: EfficiencyOfAdditionalCostV4[] = [];
constructor(private servise: ChainModule){
}
ngOnInit() {
this.service.getEfficiencyOfAdditionalCostRes().then(res => {
this.data = res;
});
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question