简体   繁体   English

WebStorm 2016.2.3无法识别html标记中的* ngFor

[英]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. 我正在使用Angular 2迈出第一步,并且在WebStorm中遇到一种奇怪的行为,如下所示。 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. 在浏览器方面一切正常 ,但WebStorm仍在抱怨。 Am I missing something? 我想念什么吗? Please, find below my WebStorm specs. 请在下面找到我的WebStorm规格。

  • WebStorm 2016.2.3 WebStorm 2016.2.3
  • Build #WS-162.1812.21, built on September 4, 2016 Build#WS-162.1812.21,建于2016年9月4日
  • Subscription is active until October 2, 2017 订阅有效期至2017年10月2日
  • For educational use only. 仅用于教育用途。
  • JRE: 1.8.0_112-release-b343 x86_64 JRE:1.8.0_112-release-b343 x86_64
  • JVM: OpenJDK 64-Bit Server VM by JetBrains sro JVM:JetBrains sro的OpenJDK 64位服务器VM

I guess you are using a very old version/guide of angular2. 我想您使用的是angular2的非常旧的版本/指南。 The template syntax has changed for a while now. 模板语法已经更改了一段时间。 To do a for loop you have to use the let keyword: 要进行for循环,您必须使用let关键字:

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

For the latest documentation and quickstart, best way to start is at angular.io 有关最新文档和快速入门,最好的启动方法是在angular.io

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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