-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
strictTemplates, Angular 9, Type 'string' is not assignable to type 'NgbPanel' #3619
Comments
@kknD7J3fPUGDMNR unfortunately at the moment I'd suggest you use the combination of: "strictTemplates": true,
"strictInputTypes": false, to disable the input type checks to "workaround" the problem. At the moment our public APIs don't fully conform to |
Can we have a list of things to change/overhaul in separate item, so we could iterate on them? Thx! |
@peterblazejewicz actually looking into it right now, not so many things to change. Will open a PR soon. |
Fixes the following use-cases for the public APIs: 1. Boolean `@Input`s like `disabled` where value is not required ```html <component disabled></component> ``` by adding ```ts static ngAcceptInputType_disabled: boolean | ''; ``` 2. All union types like `'vertical' | 'horizontal'` ``` // template <nav ngbNav [orientation]="orientation"></nav> // component orientation = 'vertical'; ``` by adding: ```ts static ngAcceptInputType_orientation: string; ``` 3. Cases where the directive selector matches the input with the optional value ```html <button [ngbPanelToggle]="p"></button> <button ngbPanelToggle></button> ``` by adding: ```ts static ngAcceptInputType_ngbPanelToggle: NgbPanel | ''; ``` Also makes all internal library templates to work with `strictTemplates`. Fixes ng-bootstrap#3619
Fixes the following use-cases for the public APIs: 1. Boolean `@Input`s like `disabled` where value is not required: ```html <input ngbButton disabled></input> ``` by adding ```ts static ngAcceptInputType_disabled: boolean | ''; ``` 2. All union types like `'vertical' | 'horizontal'`: ``` // template <nav ngbNav [orientation]="orientation"></nav> // component orientation = 'vertical'; ``` by adding: ```ts static ngAcceptInputType_orientation: string; ``` 3. Cases where the directive selector matches the input with the optional value ```html <button [ngbPanelToggle]="p"></button> <button ngbPanelToggle></button> ``` by adding: ```ts static ngAcceptInputType_ngbPanelToggle: NgbPanel | ''; ``` Also makes all internal library templates to work with `strictTemplates`. Fixes ng-bootstrap#3619
Fixes the following use-cases for the public APIs: 1. Boolean `@Input`s like `disabled` where value is not required: ```html <input ngbButton disabled></input> ``` by adding ```ts static ngAcceptInputType_disabled: boolean | ''; ``` 2. All union types like `'vertical' | 'horizontal'`: ``` // template <nav ngbNav [orientation]="orientation"></nav> // component orientation = 'vertical'; ``` by adding: ```ts static ngAcceptInputType_orientation: string; ``` 3. Cases where the directive selector matches the input with the optional value ```html <button [ngbPanelToggle]="p"></button> <button ngbPanelToggle></button> ``` by adding: ```ts static ngAcceptInputType_ngbPanelToggle: NgbPanel | ''; ``` Also makes all internal library templates to work with `strictTemplates`. Fixes #3619
I have this error after update: |
@aleeeftw what update? please open a new issue following the template if you have any problems. |
@maxokorokov Hmmm?! |
Same error for me appears in |
@andzejsw not yet released, but merged in master. Please either use master or wait for |
@maxokorokov - forgive my ignorance, but how do I install the master branch? When I do |
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.(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
The text was updated successfully, but these errors were encountered: