Reputation: 20565
I am trying to pass a ★
(★) as a parameter however when I attempt it I get:
syntax Error: Token ''★★' is not a valid identifier'
Here is my code:
<question-rating-stats
rating-data="{values:[15,15,20,20,30], labels:['★'.'★★','★★★','★★★★','★★★★★'], avg: 3.5}"
question="{question: 'Give me stars'}">
</question-rating-stats>
So my question is how do I pass these parameters?
Upvotes: 0
Views: 234
Reputation: 9881
I think the problem is the "." sign in your label array. If what you want is a concatenation, use +
. If there are two items, use ,
:
labels:['★' + '★★','★★★','★★★★','★★★★★']
In javascript, .
is used to access properties of an object
. Here, it tries to access a property of ★★
, which is obviously a string, not an object.
Upvotes: 1