0

Is there a way to print the .key() of an item in an ng-repeat. My providers object looks like this.

"providers" : {
  "provider1" : { "name" : "The Whittington Hospital" },
  "provider2" : { "name" : "Homerton Hospital" },
  ...
},

Is there a way to print an ng-repeat of the .key() of my item (provider1, provider2)? Like so:

<ul><li ng-repeat="p in providers">print .key() here</li></ul>

Any help with this is appreciated. Thanks in advance!

realph
  • 4,481
  • 13
  • 49
  • 104

1 Answers1

0

This worked:

<ul><li ng-repeat="p in providers">{{ p.$id }}</li></ul>
realph
  • 4,481
  • 13
  • 49
  • 104