SHARE
TWEET
Untitled
a guest
Jan 15th, 2016
8
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- 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 ?
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
