Ngx-bootstrap: Angular5 Alert Bug - "No provider for TemplateRef"

Created on 25 Jan 2018  路  7Comments  路  Source: valor-software/ngx-bootstrap

_### Bug description or feature request:_
There is an error importing AlertModule when loadChildren is used. The same code with BsDropdownModule works. The error is:

The error says:
ERROR Error: StaticInjectorError[TemplateRef]:
StaticInjectorError[TemplateRef]:
NullInjectorError: No provider for TemplateRef!

_### Plunker/StackBlitz that reproduces the issue:_
stackblitz.com/edit/angular-s4mmq4

_### Versions of ngx-bootstrap, Angular, and Bootstrap:_
"ngx-bootstrap": "1.9.3",
"bootstrap": "4.0.0-beta.2",
"angular": "5.0.1",

can be closed? comp(alerts) reproduce

Most helpful comment

All 7 comments

@IlyaSurmay I have just seen you tagged it with "needs: reproduce" but I provided a stackblitz. Is it not enought?

Stackblitz is broken, can you fix it? I get Maximum call stack size exceeded

I let you the code here: https://embed.plnkr.co/Lk3lXWZszG6yRcmD0lw8/ but it's not working as I can't import ngx-bootstrap to config.js Maybe it's not posible or maybe I don't know how to do it. But at least you can copy the code and use in your enviroment.

Any version newer than 1.9.3 uses ng-template. So please update to the latest version, 2.0.2

Sorry, maybe I went to the code in github of the branch master https://github.com/valor-software/ngx-bootstrap/blob/master/src/alert/alert.component.ts, so I tought it was the code of version 2.0.2. I didn't now the branch I should see was develop :P

@Kurara thanks, i have soved my issue,by changing the tag