strictTemplates, Angular 9, Type 'string' is not assignable to type 'NgbPanel'
See original GitHub issueBug description:
Enabling the new strictTemplates
flag in Angular 9’s compiler options generates the following build error:
error TS2322: Type 'string' is not assignable to type 'NgbPanel'
pointing to any use of ngbPanelToggle
i.e.
<ng-template ngbPanelHeader let-opened="opened">
<div class="d-flex align-items-center justify-content-between">
<h5 class="m-0">First panel - {{ opened ? 'opened' : 'collapsed' }}</h5>
<button ngbPanelToggle class="btn btn-link p-0">Toggle first</button>
</div>
</ng-template>
(taken from https://ng-bootstrap.github.io/#/components/accordion/examples#header)
Versions of Angular, ng-bootstrap and Bootstrap:
Angular: 9.0.2
ng-bootstrap: 6.0.0
Bootstrap: 4.4.1
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Type 'string' is not assignable to type 'number' when using ...
The error occurs when strictTemplates is enabled, i think its a bug. You can use "$any(*)". So instead of using [title]="entry.title".
Read more >Angular - type 'string' is not assignable to type 'boolean' - Solved
I would like to share with you angular template type 'string' is not assignable to type 'boolean'. you will learn angular directive type...
Read more >Typescript Compiler Never Error: Type 'String | Number' Is Not ...
Bug description: Enabling the new strictTemplates flag in Angular 9's compiler options strictTemplates, Angular 9, Type 'string' is not assignable to type ......
Read more >Angular — Type string is not assignable to type boolean
A quick fix would be to cast the string to a boolean, this can be done by adding a double exclamation mark as...
Read more >[Solved]-Type 'HTMLElement' is not assignable to type 'string
[Solved]-Type 'HTMLElement' is not assignable to type 'string | TemplateRef<any>' when trying to use HTML template for ngx-popover-angular.js.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
sorry, @aleeeftw my bad, wrong mention. I meant @andzejsw 😃
@maxokorokov Hmmm?!