I have an app I am trying to upgrade to angular 5 and library-tize. I setup ng-packagr so the lib is built and bundled, this is no problem until I try to use one of the components with ngIf or ngFor which give me the error
HeaderComponent.html:13 ERROR Error: StaticInjectorError[ViewContainerRef]:
StaticInjectorError[ViewContainerRef]:
NullInjectorError: No provider for ViewContainerRef!
at _NullInjector.get (core.js:993)
at runtime. I have looked around and tried some different things but nothing seems to fix it...
Here is relevant module code for the library.
@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 {}
Here is the HTML where the error is reported.
<a class="hidden-xs" trigger-resize="" (click)="toggleCollapsedSideabar()" *ngIf="!isCollapsedText()">
<i class="material-icons">menu</i>
</a>