【发布时间】:2020-06-05 21:08:33
【问题描述】:
我正在开发一个 Angular 库并希望传入配置。到目前为止,所有这些都在工作,但我遇到的问题是当我在 app.module forroot 中设置配置时,我会对可用的配置选项没有任何智能感知。
如果在本地运行它,不应该有一些智能感知,以便用户知道他们必须填写哪些选项吗? 当我去填写 baseUrl 时,我没有得到任何自动完成/智能感知可供我使用的选项。
FiltersModule.forRoot({
baseUrl: CONFIG.baseUrl,
} as any),
图书馆
export class FiltersModule {
public static forRoot(configuration: Config): ModuleWithProviders {
return {
ngModule: FiltersModule,
providers: [
{
provide: Config,
useValue: configuration,
},
],
}
}
}
export class Config {
baseUrl?: string;
baseUrlSSL?: string;
clmTools?: string;
}
另外,我在 intellij 和 vscode 中都有这个问题
提前致谢!
【问题讨论】:
标签: angular autocomplete intellisense angular-library