我正在努力将一个库从角12升级到角13,这是在另一个角度应用程序中使用的。我有一种情况,组件将以循环方式使用。
示例
one.component.ts:
@Component({
selector: 'lib-one',
template: `<div><lib-two></lib-two></div>`,
styles: [],
})
export class OneComponent {}two.component.ts:
@Component({
selector: 'lib-two',
template: `<div><lib-one></lib-one></div>`,
styles: [],
})
export class TwoComponent {}当我试图构建库时,我会得到一个错误,例如:
error NG3003: One or more import cycles would need to be created to compile this component, which is not supported by the current compiler configuration.处理此问题的一种方法是从tsconfig.lib.prod.json中删除以下代码
"angularCompilerOptions": {
"compilationMode": "partial"
}还有别的办法可以解决吗?
请注意组件1和2可以在不同的模块中使用,并根据某些条件使用循环方式。
提前谢谢。
https://stackoverflow.com/questions/71765405
复制相似问题