Vscode-ng-language-service: incorrect template errors with union types

Created on 8 Feb 2018  路  3Comments  路  Source: angular/vscode-ng-language-service

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

bug tracking in angular

Most helpful comment

Tracking in angular/angular as https://github.com/angular/angular/issues/22125

All 3 comments

Tracking in angular/angular as https://github.com/angular/angular/issues/22125

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._

Was this page helpful?
0 / 5 - 0 ratings