-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
bug(Table Schematic Code): Build warning error in the 'table' schematic code #27329
Comments
I would be happy to contribute to this change after triage. |
@crisbeto Is this due to any recent changing in Schematics code? |
It's due to the new extended template diagnostics coming from the framework. I'll sort it out. |
Fixes that the table schematic was producing a template diagnostic for null checking a value that doesn't need to be null checked. Also removes an unnecessary constructor. Fixes angular#27329.
…ngular#27407) Fixes that the table schematic was producing a template diagnostic for null checking a value that doesn't need to be null checked. Also removes an unnecessary constructor. Fixes angular#27329.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Is this a regression?
The previous version in which this bug was not present was
No response
Description
When creating a fresh Angular v16.1.0 project, then adding Angular Material to the project, and finally adding the 'table' schematic to produce an example component, the component produces an Angular build warning error in line 20 of the html template stating that the '?.' operator can be replaced with the '.' operator.
Reproduction
StackBlitz link: Build Warning Error
Steps to reproduce:
5.1 In app.component.ts file, change code line from:
imports: [CommonModule],
..to..
imports: [CommonModule, MyTableComponent],
5.2 In app.component.ts file, after the code line:
import { CommonModule } from '@angular/common';
..put an additional code line..
import { MyTableComponent } from './my-table/my-table.component';
"Warning: src/app/my-table/my-table.component.html:20:29 - warning NG8107: The left side of this optional chain operation does not include 'null' or 'undefined' in its type, therefore the '?.' operator can be replaced with the '.' operator."
Note: The Stackblitz code sample should show the error
Expected Behavior
No Build warning error will appear.
Actual Behavior
Code will compile with out any errors.
Environment
The text was updated successfully, but these errors were encountered: