Znowman Znowman - 7 months ago 61
JSON Question

Angularjs syntax error

Trying to output data from an API:


Gives an error:
Syntax Error: Token '.3' is an unexpected token at column 19 of the expression [forecast.list.rain.3h] starting at [.3h].
saying that .3 is the error, integers not allowed in {{....}}?
This seems problematic when the data is stored like this:



Well you can't reference this property with dot-notation since a valid identifier may not start with a number. Use {{forecast.list.rain['3h']}} instead.