Im trying to bind XML data to a variable in AngularJS.
The data returned from my service is in XML
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">
<Response>
  <Firstname>Johanna</Firstname>
</Response></string>
I then use x2js to parse the xml and get this returned:
var jsonResponse = x2js.xml_str2json(response);
Finally I want to bind Firstname to $scope.firstname
This is where I need help. I dont know what to do to bind the value. What ive tried:
$scope.firstname = jsonResponse.Response.Firstname;
> TypeError: Cannot read property 'Firstname' of undefined
$scope.firstname = jsonResponse.Object.Object.toString.__text.Response.Firstname
> TypeError: Cannot read property 'Object' of undefined
Ive tried a bunch of different combinations to try get to Firstname but none are working. I either get the above error or an undefined message.
What am I doing wrong? Please help.
