"Calling functions is not supported. Consider replacing a function or lambda with a link to an exported function, character resolution"

I get the following problem when using my custom component.

Error: The error detected static character resolution values. Function calls are not supported. Consider replacing t does it work or lambda with reference to the exported function, resolving the getValue character in E: / AOT / systemjs-aot-16 62901741 / SRC /

core.ts

export function getValue( ):any{ return "";} 

Cas-component.ts

 import { getValue } from './core.ts'; export let compTest = getValue(); 

app.module.ts

 import { compTest } from './cus-component'; @NgModule({ imports: [BrowserModule, FormsModule, HttpModule, RouterModule.forRoot(rootRouterConfig, { useHash: true })], declarations: [ HomeComponent,compTest ], bootstrap: [AppComponent] }) export class AppModule { } 
+6
source share
1 answer

Just guess, but maybe this solves your problem:

 export function getValue() { () => ''; } 
0
source

Source: https://habr.com/ru/post/1014406/


All Articles