Thank you Luke!
On Wednesday, March 5, 2014 7:19:18 AM UTC, Luke Kende wrote:
>
> Just reference it from the the userData array:
>
> <tr ng-repeat="emp in employees">
> <td>{{ emp.name }}</td>
> <td>{{ emp.city }}</td>
> <td>{{ emp.date }}</td>
> <td>{{ dateConvert(emp.date, -4) | date:'MM/dd/yyyy HH:mm:ss' }}</td>
> <td><div>{{ userData[0].offset }}</div></td>
> </tr>
>
> On Tuesday, March 4, 2014 1:58:09 PM UTC-7, Brian White wrote:
>>
>> Also, the Plunker code does display the offset (-4) in the User Offset
>> column for the employee table. But the only way I could get it to work was
>> to add another (nested) ng-repeat, which doesn't seem like the correct way
>> to go. I am interested in understanding how I can reference the equivalent
>> of user.offset without using a nested ng-repeat. Thank you.
>>
>>
>>
>> On Tuesday, March 4, 2014 8:53:07 PM UTC, Brian White wrote:
>>>
>>> Hello! I'm new to AngularJS and could really use some help
>>> understanding how to reference "parent?" $scope data while inside
>>> ng-repeat. I'm just using the following scenario for
>>> experimentation/learning purposes.
>>>
>>> Per index.html below, I bootstrap "testApp" (see app.js) and inject
>>> testControllers (controllers.js) and testServices (services.js). I have a
>>> single controller called MainController into which I inject
>>> 'employeeService' and 'userService'.
>>>
>>> employeeService returns a list of employees. userService returns user
>>> profile settings for a logged in user. I use ng-repeat to display the list
>>> of employees from employeeService and want to use the offset from
>>> userService to adjust the employee hire date. But I cannot figure out how
>>> to reference the offset from userService while inside the ng-repeat for
>>> employeeService.
>>>
>>> I can use a ng-repeat for userService data and employeeService data
>>> separately to display the results for both. But I just can't figure out
>>> how to make reference to the userService data while inside the ng-repeat
>>> for employeeService data.
>>>
>>> Any help or pointers are greatly appreciated!
>>>
>>> http://plnkr.co/edit/SGelNpTbCtXb5UaA6DFk
>>>
>>>
>>> Thanks,
>>> Brian
>>>
>>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.