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 srcappcomponentsloginlogin.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; }
Most helpful comment
Have you tried to specify the tokenGetter as following?
Otherwise you can try using a custom options factory, see README.md.