With the following component
@Component({
selector: 'my-app',
template: `
<div>
<h2>Hello {{name}}</h2>
<p *ngIf="name == 'steve'">hi steve</p>
</div>
`,
})
export class App {
name: string | number;
constructor() {
this.name = `Angular!`
}
}
current behaviour: An error is given for the *ngIf value: [Angular] Expected the operants to be of similar type or any.
expected behaviour: No template error
appears similar to https://github.com/angular/vscode-ng-language-service/issues/16
Tracking in angular/angular as https://github.com/angular/angular/issues/22125
Closing this since it's fixed in https://github.com/angular/angular/blob/5f76de1d71ac40654b5eef2d58747a713aab5c06/packages/language-service/test/diagnostics_spec.ts#L195-L210
If error still persists, please open a new issue.
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
Tracking in angular/angular as https://github.com/angular/angular/issues/22125