2

I want to iterate and display the values from "detailsController".

<div ng-controller="detailsController">
         <div ng-repeat="data in details" id="{{data.Id}}">
                {{data.Name}}
         </div>
      </div>
  • 1
    Duplicate: https://stackoverflow.com/questions/15127834/how-can-i-iterate-over-the-keys-value-in-ng-repeat-in-angular – Rui Silva Oct 12 '17 at 14:53
  • @RuiSilva - I know the iteration which i'm alreading implementing, i was looking as shown in working demo plnkr http://plnkr.co/edit/kcwq12VKhu4wItYxcsWh?p=preview , i want to iterate the list and show individual items of detailsController as shown in working demo http://plnkr.co/edit/kcwq12VKhu4wItYxcsWh?p=preview – user8727958 Oct 12 '17 at 15:06
  • @user8727958 - I'm sorry, then I don't fully understand your question... – Rui Silva Oct 12 '17 at 15:08
  • Please find working demo http://plnkr.co/edit/kcwq12VKhu4wItYxcsWh?p=preview , i want to iterate $rootScope.details and show items individually as shown in above plunker. This is my current http://plnkr.co/edit/96h6qJ7KYEZrpX0zZZ06?p=preview in which i need to iterate $rootScope.details and show each element individaully for 5seconds as shown in working demo @RogerC – user8727958 Oct 12 '17 at 15:14

1 Answers1

1

By adding a new ng-repeat using (key, value) you can iterate through the properties of the objects in details :

  <div ng-if="show ==4" ng-controller="detailsController">
       <div ng-repeat="data in details" id="{{data.Id}}">
         <p ng-repeat="(key, value) in data">
          {{value}}
         </p>
     </div>
  </div>

Is that what you're trying to achieve?

I forked your plnkr here

Guillaume Georges
  • 3,878
  • 3
  • 14
  • 32