I am trying to post data like this using AngularJS with FormData.
data = {
'album_name': 'The Grey Album',
'artist': 'Danger Mouse',
'tracks': [
{'order': 1, 'title': 'Public Service Announcement', 'duration':
245, 'thumbnail' : 'image1filehere'},
{'order': 2, 'title': 'What More Can I Say', 'duration': 264, ,
'thumbnail' : 'image2filehere'},
{'order': 3, 'title': 'Encore', 'duration': 159, 'thumbnail' :
'image3filehere'},
],
}
But its converting the array to string as shown below, but I want the it as
shown above.
data = {
'album_name': 'The Grey Album',
'artist': 'Danger Mouse',
'tracks': "[
{'order': 1, 'title': 'Public Service Announcement', 'duration':
245, 'thumbnail' : 'image1filehere'},
{'order': 2, 'title': 'What More Can I Say', 'duration': 264, ,
'thumbnail' : 'image2filehere'},
{'order': 3, 'title': 'Encore', 'duration': 159, 'thumbnail' :
'image3filehere'},
]",
}
How to achieve that using AngularJS. Which form type should I use for this.
Form Data or any other ?
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.