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

[ADF-5432] component template and code fixes after testing Angular strict mode #7118

Merged
merged 15 commits into from
Jun 22, 2021

Conversation

DenysVuika
Copy link
Contributor

@DenysVuika DenysVuika commented Jun 22, 2021

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (check one with "x")

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation
  • Other... Please describe:

What is the current behaviour? (You can also link to an open issue here)

What is the new behaviour?

Enable strict mode for the component templates (Angular compiler)

multiple fixes for the issues found when enabling the strictTemplates compilation option with Angular.
those are the small portion of fixes, more changes will be needed to enable the strict mode permanently
(note that with Angular 12 this mode is on by default).

For more details please check:

Does this PR introduce a breaking change? (check one with "x")

  • Yes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:
https://alfresco.atlassian.net/browse/ADF-5432

data-automation-id="app-group-app-input"/>
</mat-form-field>
<mat-form-field class="app-preselect-value-full">
<mat-label>Preselect: {{ DEFAULT_GROUP_PLACEHOLDER }}</mat-label>
<input matInput
(input)="setGroupsPreselectValue($event.target?.value)"
(input)="setGroupsPreselectValue($any($event).target?.value)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the recommended way?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it is a suggested way to address untyped events, like DOM ones, see https://angular.io/guide/template-typecheck#disabling-type-checking-using-any

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other way would be type casting in the event handler function

@DenysVuika DenysVuika changed the title component template and code fixes after testing Angular strict mode [ADF-5432] component template and code fixes after testing Angular strict mode Jun 22, 2021
@DenysVuika DenysVuika merged commit 829805e into develop Jun 22, 2021
@DenysVuika DenysVuika deleted the strict-templates branch June 22, 2021 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants