1
AngularJSの変数にXMLデータをバインドしようとしています。データは私のサービスから返さ解析されたXMLデータをAngularJS変数にバインドします。
私は、XMLを解析するためにx2jsを使用して、これが返されますXML
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">
<Response>
<Firstname>Johanna</Firstname>
</Response></string>
である:
var jsonResponse = x2js.xml_str2json(response);
最後に私がバインドします名前から$ scope.firstname
これは私が助けを必要とするところです。私は値をバインドするために何をすべきか分からない。 は、IVEが試したもの:
$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
アイブ氏は、ファーストネームを取得しようとする異なる組み合わせの束を試したが、どれも機能していません。私は上記のエラーまたは未定義のメッセージを取得します。
私は間違っていますか?助けてください。
素晴らしい!!ありがとうございました – JCom09