简体   繁体   中英

pass isDevMode to forRoot throw error in Prod env

the code like as bellow

const isDev = isDevMode()
const modules = [
    HttpClientModule,
    NgxsModule.forRoot(AllStates, { developmentMode: isDev }),
]

this code work well in development env, but will throw an error in prod env. The error is Error during template compile of 'CoreModule' Function calls are not supported in decorators but 'isDevMode' was called.

Is there a way to pass isDevMode to forRoot function? Thanks

最后,我使用const isDev = !environment.production ,并且运行良好。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM