Within my Angular application, I am attempting to implement a factory provider in one of my modules:
export function retrieveMyFactory(): () => Window {
return () => window;
}
@NgModule({
providers: [
{ provide: WindowRef, useFactory: retrieveMyFactory() },
],
})
export class MyModule {}
This implementation is running into an issue, resulting in the following error message:
An error was detected in the metadata generated for the exported symbol 'MyModule':
The collected metadata contains an error that will be reported during runtime: Lambda not supported.