在较新的示例(seeds,angular.io,..)中,引导过程还有另一个导入:@angular/platform-browser-dynamic.
有人可以解释一下,它和它之间有什么区别@angular/platform-browser?
目前还没有关于angular.io官方网站的信息.
我有一个应用程序正在尝试升级到 Angular 5 和 Library-tize。我设置了 ng-packagr,因此构建并捆绑了 lib,这没有问题,直到我尝试将其中一个组件与 ngIf 或 ngFor 一起使用,这给了我错误
HeaderComponent.html:13 ERROR Error: StaticInjectorError[ViewContainerRef]:
StaticInjectorError[ViewContainerRef]:
NullInjectorError: No provider for ViewContainerRef!
at _NullInjector.get (core.js:993)
Run Code Online (Sandbox Code Playgroud)
在运行时。我环顾四周并尝试了一些不同的方法,但似乎没有什么可以解决它......
这是该库的相关模块代码。
@NgModule({
imports: [
CommonModule,
FormsModule,
RouterModule,
/* Bootstrap Imports */
AccordionModule,
AlertModule,
ButtonsModule,
CarouselModule,
CollapseModule,
BsDropdownModule,
ModalModule,
PaginationModule,
ProgressbarModule,
RatingModule,
TabsModule,
TimepickerModule,
TooltipModule,
TypeaheadModule,
DatepickerModule,
ServicesModule,
],
declarations: [
LayoutComponent,
HeaderComponent,
FooterComponent,
OffsidebarComponent,
SidebarComponent,
UserblockComponent,
OverlayComponent,
BusyIndicatorComponent
],
exports: [
LayoutComponent
],
providers: [
UserblockService
]
})
export class ComponentsModule {}
Run Code Online (Sandbox Code Playgroud)
这是报告错误的 HTML。
<a …Run Code Online (Sandbox Code Playgroud)