I'm facing this error in my code when using strict mode and I'm not managing it.
"message": "Type 'MyType<string>[] | undefined' must have a '[Symbol.iterator]()' method
It is happenning in this line of code:
const [optionAll, ...options] = await service.getLineOfBusiness().toPromise();
this service method returns an observable of a list of MyType:
public getLineOfBusiness(): Observable<MyType<string>[]>
This MyType is quite simple interface:
export interface MyType<T = unknown> {
key: string;
value: T;
extra?: string;
}
How can I solve it?