Angular ng-repeating json fields with hyphen

<span ng-repeat="doc in docs">
   <p>{{doc.posted-Time}}</p>

All I get is a 0 instead of the actual value in the json. Is there a way to escape the '-'?

Normally I would do doc['posted-Time'] and that would do the trick, but with angular it is not working.

any help appreciated, thank you.

Answers


Remember you can use bracket notation as well.

<span ng-repeat="doc in docs">
   <p>{{doc["posted-Time"]}}</p>

Need Your Help

Where is the Android SDK folder located?

android sdk air

I created with Adobe Flash an .apk app through Air for Android.

Copy-paste using Capybara?

selenium capybara copy-paste

I would love to do something like this: