<div ng-controller='OutputController'>
<div ng-repeat='user in data.users'>
<div ng-repeat='monologue in data.monologues[user]'>
<span class='text' ng-bind='monologue.text'></span>
<span class='timestamp' ng-bind='new Date(monologue. timestamp).toLocaleString()'></span>
</div>
</div>
In my JavaScript I have:
var repeatEr = function(data, status, headers, config)
{
var interval = 1000;
angular.extend($scope, data);
In the data being sent to my page I have:
{"monologues": {"jonathan...@pobox.com": [["False", 0.0], ["False", 0.0], ["False", 0.0], ["False", 0.0], ["False", 0.0], ["False", 0.0], ["False", 0.0], ["False", 0.0], ... }, "users": ["jonathan...@pobox.com"]}
What is happening is that it is displaying empty results.
What I intend for it to do is to pull the Ajax data it is pulling, and then display the text ("False" here) and timestamps in successive DIV's.
Given the data as I have it, what should I be doing with the repeaters so that it is displaying results accordingly?
--Or--Given the repeaters I have, what should I be populating as data so that the repeaters will have what they need?
![]() |
Christos Jonathan Seth Hayward, an Orthodox Christian author. Amazon / Kindle • Author • Author Bio • Email • Facebook • Fan Page • Google Plus • LinkedIn • Professional • Twitter • Web • What's New? If you read just one of my books, you'll want The Best of Jonathan's Corner.
|
<div ng-controller='OutputController'>
<div ng-repeat='user in data.users'>
<div ng-repeat='monologue in user. monologues'>
<span class='text' ng-bind='monologue.text'></span>
<span class='timestamp' ng-bind='monologue.timestamp'></span>
</div>
</div>
</div>
Hope that gives you some direction.
--
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 angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
Hi,
My data structures might be hard to understand, but I've had graduate level coursework in data structures and a master's in applied math. Your suggestion regarding another way of structuring the data makes sense, but given your restructuring, I don't yet see confusion regarding data structures in having a list of users and a hash of lists of monologues on a per-user basis.
Wow, you must be crazy smart ;)
You did:
angular.extend($scope, data);
that means your merged your data into your scope right?
It seems to me then you need to do this:
<div ng-repeat='user in users'>
<div ng-repeat='monologue in monologues[user]'>
But then again, what do I know.
Regards
Sander
--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/8xN-TP_EIpc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.