Unexpected directive 'XXXx' imported by the module 'xxxx'

这个问题是引入其他模块时,引入了component导致的,改为引入module就可以了。

import { HeaderComponent } from '../../component/header/header.component';引用错误

改为引用import { HeaderModule } from 'src/component/header/header.module';

猜你喜欢

转载自blog.csdn.net/wangpeng9126/article/details/88059412
今日推荐