1

according to this solution i built my AngularJS app. Now i want to access a parent's value within a nested structure.

I tried this, but it does not work: http://jsfiddle.net/BwDAP/

<body  ng-app="WeeklyApp" ng-controller="WeeklyController" >
    <div ng-repeat="week in myData">
       <div ng-repeat="day in week.days">
          {{day.dow}} - {{day.templateDay}}
          <b>Jobs:</b><br/> 
           <ul>
             <li ng-repeat="job in day.jobs"> 
               {{job.name}} 
                 <br />
               <!-- PARENT -->
               parent: {{job.parent.dow}} 
             </li>
           </ul>
       </div>
    </div>
</body>

Any solutions? thx

Community
  • 1
  • 1
Johannes Scherg
  • 129
  • 2
  • 7

1 Answers1

0

A haha, too easy ;-) Here is the solution: http://jsfiddle.net/Lm6KZ/

<body  ng-app="WeeklyApp" ng-controller="WeeklyController" >
    <div ng-repeat="week in myData">
       <div ng-repeat="day in week.days">
          {{day.dow}} - {{day.templateDay}}
          <b>Jobs:</b><br/> 
           <ul>
             <li ng-repeat="job in day.jobs"> 
               {{job.name}} 
                 <br />
               <!-- PARENT -->
               parent: {{day.dow}} 
             </li>
           </ul>
       </div>
    </div>
</body>
Johannes Scherg
  • 129
  • 2
  • 7