-1

I'm trying to perform a post using angular js. In Angular, you pass the data as an object. Because of the server, I need the keys in the object to conatin dots, like the first one here:

$scope.quiz= {
    entry.358412101: 'asdf',
    formkey: '1F9trPeu9DA4W0CjADN4a1fl3Jh682ZPF8remWB21RhI',
    draftResponse: '[]'
}

Is this at all possible?

Himmators
  • 14,278
  • 36
  • 132
  • 223
  • 5
    Enclose the key in quotes. – Jon Sep 04 '13 at 08:36
  • possible duplicate of [What is the difference between object keys with quotes and without quotes?](http://stackoverflow.com/questions/4348478/what-is-the-difference-between-object-keys-with-quotes-and-without-quotes) – Jon Sep 04 '13 at 08:39
  • I would love a comment on the downvote, maybe I can learn something! – Himmators Sep 04 '13 at 08:41
  • @jon I kindly disagree, while the answer is the same, the question is different, because I didn't know ou were suppose to put quotes around the key I would have never found that question! – Himmators Sep 04 '13 at 08:42
  • That's why you asked the question and other people who do know about the relationship vote that it's a dupe. The point is that answers already exist (and they are much better than what will be found here), so both you and future visitors are better served by a link to the dupe. It has nothing to do with you personally realizing the similarity. – Jon Sep 04 '13 at 08:47
  • oh, sorry, I thought you wanted to close it, my bad ;) – Himmators Sep 04 '13 at 08:48
  • I do want to close it, and then it will look like [this](http://stackoverflow.com/questions/17820666/formatting-a-date-string-php). Closing != deleting. – Jon Sep 04 '13 at 08:50

1 Answers1

3

Exactly as Jon said:

$scope.quiz= {
    "entry.358412101": 'asdf',
    formkey: '1F9trPeu9DA4W0CjADN4a1fl3Jh682ZPF8remWB21RhI',
    draftResponse: '[]'
}
slash197
  • 9,028
  • 6
  • 41
  • 70