(im on an angular-cli app version 8)
Im trying to import a feature module
from project A into project B.
(the error after running project B in the browser)
(compiler.js:2175)
Uncaught Error: The template specified for component CrudTableComponent is not a string
at syntaxError (compiler.js:2175)
at DirectiveNormalizer.normalizeTemplate (compiler.js:17649)
at CompileMetadataResolver.loadDirectiveMetadata (compiler.js:19820)
at compiler.js:25829
at Array.forEach (<anonymous>)
at compiler.js:25828
at Array.forEach (<anonymous>)
at JitCompiler._loadModules (compiler.js:25825)
at JitCompiler._compileModuleAndComponents (compiler.js:25805)
at JitCompiler.compileModuleAsync (compiler.js:25767)
The reason Im importing from another project is that i want plan to generate a library from project A.
- In project A everything works fine:
(feature module of project A)
@NgModule({
declarations: [
>>CrudTableComponent,
>>BulkCrudTableComponent,
],
imports: [
CommonModule,
ReactiveFormsModule,
MatTableModule,
...
MatCardModule,
],
exports: [
ReactiveFormsModule,
MatTableModule,
...
MatCardModule,
>>CrudTableComponent,
>>BulkCrudTableComponent,
]
})
export class CrudTableModule {}
(feature module project B, project where I get the error, you see I leave my project (B) ...)
import { CrudTableModule } from '../../../../../../privat/mat-crud-table/src/app/crudTableProject/crud-table.module';
...
@NgModule({
declarations: [
loads of declarations ...
],
entryComponents: [
some entry components ...
],
imports: [
some imports ...
CrudTableModule,
],
exports: [
bazillion exports ....
CrudTableModule,
],
})
export class MyCoreModule {}
might be related to:
https://stackoverflow.com/a/57090749/6852937
- for me its unclear how this could help me, cant apply the "solution".
when I "play-around" and change my templateUrl:
in A to template:
weird stuff is happending:
compiler.js:2175 Uncaught Error: Template parse errors:
More than one component matched on this element.
Make sure that only one component's selector can match a given element.
Conflicting components: MatButton,MatButton ("
<mat-dialog-actions fxLayout="row nowrap" fxLayoutAlign="space-between center">
[ERROR ->]<button mat-stroked-button color="primary" (click)="logout()">Ausloggen</button>
<button "): ng:///MayaCoreModule/LogoutModalComponent.html@12:12
More than one component matched on this element.
Make sure that only one component's selector can match a given element.
Conflicting components: MatButton,MatButton (" <button mat-stroked-button color="primary" (click)="logout()">Ausloggen</button>
[ERROR ->]<button mat-stroked-button (click)="close()">Abbrechen</button>
I play around even more and I know remove the material imports to get rid of the material bull**** error.
- The app runs in the browser but I cant use my stuff (for obvious reasons).