简体   繁体   中英

WebStorm 2016.2.3 does not recognise *ngFor in html tag

I am taking my first steps using Angular 2 and I am experiencing a strange behaviour in WebStorm as shown below. It expects for a newline or something for some reason.

Sintax问题WebStorm Angular

Everything is working fine on the browser side, but WebStorm remains complaining. Am I missing something? Please, find below my WebStorm specs.

  • WebStorm 2016.2.3
  • Build #WS-162.1812.21, built on September 4, 2016
  • Subscription is active until October 2, 2017
  • For educational use only.
  • JRE: 1.8.0_112-release-b343 x86_64
  • JVM: OpenJDK 64-Bit Server VM by JetBrains sro

I guess you are using a very old version/guide of angular2. The template syntax has changed for a while now. To do a for loop you have to use the let keyword:

<tr *ngFor="let product of products"></tr>

For the latest documentation and quickstart, best way to start is at angular.io

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM