问题描述
如果我具有lodash
,@nb-bootstrap
或@fontawesome
之类的依赖项,如何在libs/shared/
nx的lib中共享这些库?
例如,我有alert-update-modal.component.html
并显示错误消息,称'fa-icon' is not a kNown element
libs/shared/alert/src/lib/alert-update-modal/alert-update-modal.component.html
...
<fa-icon [icon]="'download'"></fa-icon>
<!-- 'fa-icon' is not a kNown element ...... -->
...
libs/shared/src/lib/shared.module.ts
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { SharedLibsModule } from './shared-libs.module';
@NgModule({
imports: [CommonModule,SharedLibsModule],declarations: [],})
export class SharedModule {}
libs/shared/src/lib/shared-libs.module.ts
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule,ReactiveFormsModule } from '@angular/forms';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { NgJhipsterModule } from 'ng-jhipster';
import { InfiniteScrollModule } from 'ngx-infinite-scroll';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
import { TranslateModule } from '@ngx-translate/core';
import { DragDropModule } from '@angular/cdk/drag-drop';
@NgModule({
exports: [
FormsModule,CommonModule,DragDropModule,NgbModule,NgJhipsterModule,InfiniteScrollModule,FontAwesomeModule,ReactiveFormsModule,TranslateModule
]
})
export class SharedLibsModule {}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)