question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

strictTemplates, Angular 9, Type 'string' is not assignable to type 'NgbPanel'

See original GitHub issue

Bug 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:closed
  • Created 4 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
maxokorokovcommented, Feb 27, 2020

sorry, @aleeeftw my bad, wrong mention. I meant @andzejsw 😃

1reaction
aleeeftwcommented, Feb 27, 2020

@maxokorokov Hmmm?!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found