Here is some code that is throwing errors:
let isBrowserFactory2=function(@Inject(PLATFORM_ID) platformId: string){ return isPlatformBrowser(platformId);}
This results in the following error message:
Decorators are not valid here
And then we have this code snippet:
let isBrowserFactory=(@Inject(PLATFORM_ID) platformId: string):boolean=> isPlatformBrowser(platformId)
But unfortunately, it produces an Expression expected
error.
- Why am I encountering issues with using typescript's parameter decorators for a function?
- Is there a proper way to utilize
@Inject()
for injecting objects into a factory method?