I have an Employee model in my emberjs app, and I am trying to load the Employees content using a RESTful web service which come in the following format:
{
"Result": [
{
"EmployeeId": "1",
"EmployeeName": "Mark Smith",
"Active": 0,
"Dept": "Sales"
},
{
"EmployeeId": "2",
"EmployeeName": "John Smith",
"Active": 1,
"Dept": "Sales"
},
{
"EmployeeId": "3",
"EmployeeName": "Michael Smith",
"Active": 1,
"Dept": "Administration"
}
],
"ResultCount": 3
}
Here I am facing 3 problems:
Is it possible to read this JSON format and add it to the Employee model, I understand that "Result" should have been "Employees" but I have no control over the return JSON format so if it is possible to use "Result" that will be great. Any example on doing so is highly appreciated.
How can I handle "ResultCount"? Is there a way I can read it as part of Employee model?
How I can read "Active" in the app View as "Active" / "Not Active" instead of 0 or 1?
Thanks for your time