Angular JS沒有使用鍵名中的at(@)解析嵌套的JSON鍵 - Angular JS not parsing nested JSON key with the at (@) in the key name -开发者知识库
I am hitting an API which retrieves a nested JSON and setting it to my $scope.data variable.
我正在訪問一個API,它檢索嵌套的JSON並將其設置為我的$ scope.data變量。
I do an ng-repeat like ng-repeat="event in data"
. and try to access a value in the JSON {{event.src.@userID.title}}
我像ng-repeat =“數據中的事件”那樣進行ng-repeat。並嘗試訪問JSON中的值{{event.src。@ userID.title}}
There is an error Lexer Error: Unexpected next character at columns 14-14 [@] in expression [event.src.@userID.title]
.
Lexer Error出現錯誤:表達式[event.src。@ userID.title]中第14-14列[@]出現意外的下一個字符。
When I forcefully remove the @ from the JSON returned from the API and access as {{event.src.userID.title}}
it works properly.
當我強行從API返回的JSON中刪除@並以{{event.src.userID.title}}訪問時,它可以正常工作。
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
我點擊的API會返回一個列表[{“”:“”},{},{},{}] {“”:“”}是一個嵌套列表