Incorrect @Input size typing when strictTemplates is enabled
See original GitHub issueDescribe the bug
AOT compilation build under Angular 9 with angularCompilerOptions.strictTemplates: true in tsconfig.app.json generates a error TS2322: Type 'string' is not assignable to type 'number' when binding <as-split-area [size]="'*'">, as the @Input size is typed as number | null in the source code, though the documentation clearly states it can also be bound to '*' in pixel mode.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Template type checking - Angular
If disabled, the access modifiers of the @Input are ignored; only the type is checked. This option is false by default, even with...
Read more >How to make existing angular application "fully strict" step by ...
One good approach: Begin by typing all your models - interfaces/types/classes - as this should be the source of truth for types.
Read more >Angular 9's Best Hidden Feature: Strict Template Checking
Let's change the setting in tsconfig.json to enable strict template checks. ... entry and replace it with strictTemplates: true .
Read more >Angular compilation restrictions overview
enabling Typescript strict mode (details), thus enabling various ... Assuming an angular Input is passed to this component all console logs ...
Read more >AG Grid has Typed Angular Component Properties
It is strongly recommended to enable strictTemplates for your application ... the benefits of working with full typing we will add Input and ......
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

As a workaround, you can use
$anyin the templateHey @lf-novelt , if you check #289 you can see where it’s set. Once I finish that PR it will work without the workaround.