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.

ng9 strictTemplates issues

See original GitHub issue

Reproduction link

https://github.com/dylanvdmerwe/zorro-strictTemplates-repo

Steps to reproduce

In Angular 9, set strictTemplates to true in angularCompilerOptions in tsconfig.json. Run ng build on the repo.

Property 'subscribe' does not exist on type 'EventEmitter<any> | OnClickCallback<any>'.
  Property 'subscribe' does not exist on type 'OnClickCallback<any>'.
Type 'NzSelectComponent' is missing the following properties from type 'NgModel': control, viewModel, name, isDisabled, and 34 more.

Disabling strictTemplates allows the code to run as expected.

The repo attached is just an example of what we have run into. I am sure there are additional components and cases that would need to be checked as well.

Some additional comments here: https://github.com/NG-ZORRO/ng-zorro-antd/issues/4757

Background info: https://auth0.com/blog/angular-9s-best-hidden-feature-strict-template-checking/

What is expected?

Ng-Zorro should not prevent the additional checks implemented by strictTemplates.

What is actually happening?

Typing errors prevent the code from compiling.

Environment Info
ng-zorro-antd 9.1.0
Browser Chrome

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dylanvdmerwecommented, May 14, 2020

Thank you for this!

0reactions
hsuanxyzcommented, May 13, 2020

Hi, @dylanvdmerwe

Property ‘subscribe’ does not exist on type ‘EventEmitter<any> | OnClickCallback<any>’. Property ‘subscribe’ does not exist on type ‘OnClickCallback<any>’.

fix via #5265;

Type ‘NzSelectComponent’ is missing the following properties from type ‘NgModel’: control, viewModel, name, isDisabled, and 34 more.

need to specify the reference name to narrowing types.

<app-test-wrapper [control]="selector">
  <nz-select ngModel="lucy" #selector="ngModel">
                                       ~~~~~~~
  </nz-select>
</app-test-wrapper>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 9's Best Hidden Feature: Strict Template Checking
Subtle bugs that could cause problems? Angular 9 and the Ivy compiler do just that. The new feature is known as strict template...
Read more >
All Perks, No Hassle: An Angular 9 Tutorial - Toptal
A screenshot of an IDE showing the ng9-app folder, containing node_modules, . Now, let's add a new app. To do that, we will...
Read more >
nrwl-nx/community - Gitter
I am using NX9 with NG9 ... that doesnt need to stay that way, I found the problem there ... if you want...
Read more >
Newest 'angular9' Questions - Page 38 - Stack Overflow
Does anybody here have problems when trying to debug an Angular library with WebStorm? ... I have a simple trackBy statement which was...
Read more >
Changelog - ngx-charts - GitBook
Bug: Fix typing issues to support enabling strictTemplates option. Breaking: Upgrade Angular to v12 ... 14.0.0. Chore: explicitly only suppot ng9 ...
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