My goal is to receive a JSON raw response from R Plumber and then utilize it in Angular. However, I am encountering an issue where the JavaScript Framework is interpreting it as a string instead of recognizing it as JSON format.
"[{\"id\":1,\"type\":\"Diagnostic\"},{\"id\":2,\"type\&\quotImpact\"}]"
I have looked into solutions on Stack Overflow but haven't found one that resolves my specific problem.
How can I ensure that the data is formatted correctly so that JavaScript frameworks can interpret it properly?
#* @apiTitle Diagnostic Report API
#* Send the list of report types
#* @get /reportTypes
#* @serializer unboxedJSON
function(){
reportTypes <- read_csv(file = "ReportTypes.csv")
# list(
# message_echo = paste("The text is:", "text")
# )
}
In Angular, I am receiving the following error message. Although this may not be directly related to Angular Stack Overflow, I wanted to showcase the challenge I am facing:
Cannot find a differ supporting object '[{"id":1,"type":"Diagnositic"},{"id":2,"type":"Impact"}]' of type 'string'. NgFor only supports binding to Iterables such as Arrays.