The following code
let isBrowserFactory2=function(@Inject(PLATFORM_ID) platformId: string){ return isPlatformBrowser(platformId);}
Gets the following error:
Decorators are not valid here
And this one
let isBrowserFactory=(@Inject(PLATFORM_ID) platformId: string):boolean=> isPlatformBrowser(platformId)
Gets the Expression expected error.
- Why I can't use typescript's parameter decorators for a function?
- How can I use
@Inject()to inject something into a factory method?