我创建了一个数据库,然后尝试将该数据库包含到另一个创建的库中。构建正常,但收到了“在output.globals中未提供外部模块'my-data'的名称-猜测是'myData'”。我错过了什么?
重新创建步骤如下。
- ng new test-project --create=application=false
- cd test-project
- npm audit fix
- ng g library my-data
- ng g library my-core
- ng g application address-book
- ng build my-data
- 然后在my-core.module中添加import { MyDataModule } from 'my-data';
- 接着在my-core.module中添加imports: [MyDataModule]
- ng build my-core
my-core.module.ts
import { NgModule } from '@angular/core';
import { MyCoreComponent } from './my-core.component';
import { MyDataModule } from 'my-data';
@NgModule({
declarations: [MyCoreComponent],
imports: [MyDataModule],
exports: [MyCoreComponent]
})
export class MyCoreModule { }
- 构建后收到“在output.globals中未为外部模块'my-data'提供名称 - 猜测为'myData'”的提示
构建后收到“在output.globals中未为外部模块'my-data'提供名称 - 猜测为'myData'”的提示