I am hitting an API which retrieves a nested JSON and setting it to my $scope.data variable.
I do an ng-repeat like ng-repeat="event in data".
and try to access a value in the JSON {{[email protected]}}
There is an error
Lexer Error: Unexpected next character at columns 14-14 [@] in expression [[email protected]].
When I forcefully remove the @ from the JSON returned from the API and access as {{event.src.userID.title}} it works properly.
Please help so that I can access value with the @ in the key name.
The API that I hit returns a list [{"":""},{},{},{}] {"":""} is a nested list
You have to use a different syntax to access an object property whose name isn't a valid variable name:
{{event.src["@userID"].title}}

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With