问题描述:

This question already has an answer here:

  • Are dashes allowed in javascript variable names?

    4 answers

网友答案:

Use bracket notation

<p> {{archivi['FASE-XD']}}</p>
网友答案:

The problem is that the js parser interprets dash - as a subtract operator.

so just change

<p> {{archivi.FASE-XD}}</p>

to

<p> {{archivi['FASE-XD']}}</p>
网友答案:

The '-' is an operator, and will treat it that way. So to access the property, you will need to do {{archivi['FASE-XD']}}

相关阅读:
Top