Skip to content
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

ng9 strictTemplates issues #5171

Closed
dylanvdmerwe opened this issue Apr 28, 2020 · 5 comments
Closed

ng9 strictTemplates issues #5171

dylanvdmerwe opened this issue Apr 28, 2020 · 5 comments
Assignees

Comments

@dylanvdmerwe
Copy link

dylanvdmerwe commented Apr 28, 2020

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: #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
@vthinkxie
Copy link
Member

plz follow #4994

@dylanvdmerwe
Copy link
Author

Note that this is still an issue with version 9.1.1. Repo updated.

@vthinkxie
Copy link
Member

cc @hsuanxyz

hsuanxyz added a commit to hsuanxyz/ng-zorro-antd that referenced this issue May 13, 2020
@hsuanxyz
Copy link
Member

Hi, @dylanvdmerwe

Property 'subscribe' does not exist on type 'EventEmitter | OnClickCallback'.
Property 'subscribe' does not exist on type 'OnClickCallback'.

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>

hsuanxyz added a commit to hsuanxyz/ng-zorro-antd that referenced this issue May 13, 2020
@dylanvdmerwe
Copy link
Author

Thank you for this!

hsuanxyz added a commit to hsuanxyz/ng-zorro-antd that referenced this issue Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants