Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Function calls are not supported in decorators but 'FileTypeModule' was called

trying to setup ngx-formly-material-file, but I got an error: Function calls are not supported in decorators but 'FileTypeModule' was called

I tried to export FileTypeModule, but got the same error

export const fileTypeModule = FileTypeModule.forRoot();

@NgModule({
  imports: [fileTypeModule]

})
like image 316
Sh eldeeb Avatar asked Jan 20 '20 12:01

Sh eldeeb


Video Answer


1 Answers

Have seen this happening many times, last time, with Angular 9, happened during ng build <my-library>, for all modules that were initialized with forRoot

I added in tsconfig.lib.json this and the error went away.

 "angularCompilerOptions": {
    "fullTemplateTypeCheck": true
  }

The fullTemplateTypeCheck compiler switch actually enables the binding expression validation phase of the template compiler. See more details here.

like image 170
Florin D Avatar answered Sep 25 '22 00:09

Florin D