以下のコードを使用して、次のような JSON オブジェクトを作成しています。
{"contacts":[{"provider":"Yahoo","firstName":"myname","lastName":"surname","nickname":"mynick","email":"myemail@hotmail.com","photoURL":"http://l.yimg.com/dh/ap/social/profile/profile_bxx.png"}]};
var data = {};
var contacts;
var gc = $.when(gigya.socialize.getContacts({callback: function(response){
data['contacts'] = response.contacts.asArray();
}}));
gc.done(function(response) {
contacts = data;
});
console.log(contacts);
結果の連絡先オブジェクトを Google soy テンプレートに渡すと、JSON オブジェクトが適切に構築されていないように見えます。
上記のコードで、有効な JSON オブジェクトを作成するにはどうすればよいでしょうか?
助けてくれてありがとう。