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.

Incorrect @Input size typing when strictTemplates is enabled

See original GitHub issue

Describe 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:open
  • Created 4 years ago
  • Reactions:5
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
literalpiecommented, Jun 18, 2020

As a workaround, you can use $any in the template

	<as-split-area [size]="$any('*')">hello</as-split-area>
1reaction
beemancommented, Mar 1, 2021

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

Read more comments on GitHub >

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

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