abstract class Filter<T> {
protected filter = new Map<T>();
}
I get this error message:
No overload expects 1 type arguments, but overloads do exist that expect either 0 or 2 type arguments
Why?
TypeScript 3.9.2
Full abstract class with all methods:
abstract class Filter<K, T> {
protected filterModel = new Map<K, T>();
constructor(protected array: any, private model: T[]) {}
abstract filter(): void;
reset(): void {
this.filterModel.clear();
}
set(item: T) {
this.filterModel.set("sss", item);
}
get(): T[] {
return this.model;
}
}
Problem is in line: this.filterModel.set("sss", item);
Using is:
class FilterByOrderStatus extends Filter<string, FilterOrderStatus> {
}
So, I try to fill filter model