Function expressions are not supported in decorators in 'ɵ0'
I'm getting this error when I do an aot build.
ERROR in Error during template compile of 'LoginModule' Function expressions are not supported in decorators in 'ɵ0' 'ɵ0' contains the error at src\app\components\login\login.module.ts(23,22) Consider changing the function expression into an exported function.
I suspect it's because I have a lambda in my module... JwtModule.forRoot({ config: { tokenGetter: () => { return ''; } } })
Have you tried to specify the tokenGetter as following?
export function jwtTokenGetter() {
return ...;
}
JwtModule.forRoot({
config: {
tokenGetter: jwtTokenGetter
}
})
Otherwise you can try using a custom options factory, see README.md.
That works, thanks.
Important:
This wont work:
export const myFunc = (): boolean => true;
This will work:
export function myFunc(): boolean { return true; }