can any one please explain me how to use nested ng-repeat.

67 views
Skip to first unread message

dhe...@cloudchowk.com

unread,
Dec 23, 2014, 4:15:43 AM12/23/14
to ang...@googlegroups.com

i have a problem that "when i click on 1st ng-repeat text then 2nd (nested) ng-repeat displayed data(this data retrieving from database) instead of showing data at that part it shows data for all (parent)ng-repeat"
can any one know how to correct this problem 

Sander Elias

unread,
Dec 23, 2014, 5:00:36 AM12/23/14
to ang...@googlegroups.com
Hi Dhe...,

Well, sure one of us can help you. Based on your current description of your problem, my guess would be, you are doing something wrong ;)
Build a plunk demonstrating your issue, and we will help you. It's pretty next to impossible to help you without seeing your code! ;)

Regards
Sander

Dheeraj Kumar

unread,
Dec 23, 2014, 5:21:35 AM12/23/14
to ang...@googlegroups.com
Hi Sander,
Thanks you!!
This is my code-http://plnkr.co/edit/VUV9tKkYlCZkEDKCd4Sh?p=catalogue


Regards


--
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/Wt4o1DLuIJs/unsubscribe.
To unsubscribe from this group and all its topics, 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.

Sander Elias

unread,
Dec 23, 2014, 5:56:59 AM12/23/14
to ang...@googlegroups.com
Hi Dheeraj,

You code is lacking the data that it needs to display, so it isn't a working sample.
a question, what is  `CategoryDetailList[current]` why aren't you just iterating over `Category` in your second loop?

Regards
Sander

Dheeraj Kumar

unread,
Dec 23, 2014, 6:09:24 AM12/23/14
to ang...@googlegroups.com, Sander Elias
Hi,

Isn't 'CategoryDetailList[current]' and `Category` are the same thing?
i dont have no right to share data with anyone,but i can tell you what they are returning 'GetAllCategoryName' and 'GetAllDetailsforCategoryName' services are returning a json.
'
GetAllDetailsforCategoryName' service returning data to correspond to click event.

Regards

--

Sander Elias

unread,
Dec 23, 2014, 6:32:28 AM12/23/14
to ang...@googlegroups.com, sande...@gmail.com

Hi Dheeraj,

Fake data is ok. I don’t need, your actual data, as long as it formed like your own data.
I don’t see you setting current or CategoryDetailList anywhere, so I can’t tell if they are the same.
There are so many things missing, that’s really hard to help you.

Regards
Sander

Dheeraj Kumar

unread,
Dec 23, 2014, 6:47:33 AM12/23/14
to ang...@googlegroups.com, Sander Elias
Hi Sander,
Data:-
'GetAllCategoryName' returns
["Mobile Changed", "SMS Notification", "Appointment", "Password Reset", "Reminder", "Mobile Change", "Prescription", "Password Changed", "MobileNo Update"]
'GetAllDetailsforCategoryName' returns for "Password Reset"
Object
  1. Body: "Hello {UserName},↵You recently requested a password reset for for UserCode: {StaffCode}. To create a new password, click on the link below:↵{ResetPasswordLink}↵Request Time: {ResetPasswordLinkSendTime}↵Regards,↵cloudchowk"
  2. CategoryName: "Password Reset"
  3. CategoryType: "SMS Template"
  4. SubCategory: "Doctor"
  5. SubCategoryType: "Password Reset"
  6. Subject: ""
  7. TemplateId: "a36a5d96-5f06-4a31-b208-54396ed4f2b6"
  8. TemplateName: "Template 1"
  9. UserRoleId: "93127ac8-7739-4347-8f4f-045a8d129ce3"
  10. __proto__: Object
,
Object
  1. Body: "<!-- 100% wrapper -->↵<table border="0" width="100%" cellspacing="0" cellpadding="0" bgcolor="#eaeaea">↵<tbody>↵<tr>↵<td align="center" valign="top"><br /> <!-- 600px container (white background) -->↵<table class="container" style="border: 1px solid #dddddd;" border="0" width="600" cellspacing="0" cellpadding="0" bgcolor="#ffffff"><!-- 600px Header -->↵<tbody>↵<tr>↵<td class="container-padding" style="background-color: #ffffff; padding-left: 30px; padding-right: 30px; font-size: 14px; font-family: Arial, Helvetica, sans-serif; color: #333; border-bottom: 2px solid #0099ff;" align="left" bgcolor="#ffffff"><br /> <a style="text-decoration: none;" href="http://cloudchowk.com/" target="_blank"> <img style="display: block;" title="cloudchowk Logo" src="https://cdn.cloudchowk.com/Images/em/email-1-2.jpg" alt="" width="187" height="36" border="0" hspace="0" vspace="0" /> </a> <br /> <!--/ end .columns-container--></td>↵</tr>↵<!--/ end .header -->↵<tr>↵<td class="container-padding" style="background-color: #ffffff; padding-left: 30px; padding-right: 30px; font-size: 13px; line-height: 20px; font-family: Arial, Helvetica, sans-serif; color: #666666;" align="left" bgcolor="#ffffff"><br />↵<p>Hi {Salutation} {firstname},</p>↵<p>This email has been sent by cloudchowk in response to your request to reset your password for your id&nbsp;{StaffCode}.</p>↵<p>To reset your password and access your account, either click here or on the button below (expires in 24 hours).</p>↵<a class="big-button-style" style="border: 1px solid #0091d1; color: #fff; background-color: #0091d1; text-align: center; text-decoration: none; -webkit-text-size-adjust: none; font-size: 13px; line-height: 34px; display: inline-block; width: 40%; border-radius: 3px; font-family: Arial, Verdana, sans-serif; font-weight: 400;" href="{ResetPasswordLink}"> RESET PASSWORD</a>↵<p>If you did not request for this change and believe your account has been compromised, please contact cloudchowk team at <a href="#">sup...@cloudchowk.com</a></p>↵<p>Request Time:&nbsp;{ResetPasswordLinkSendTime}</p>↵<br />↵<p>Regards <br /> <strong>cloudchowk Solutions Pvt. Ltd.</strong></p>↵<br />↵<p>P.S.: To get the most out of your account we recommend downloading our mobile app from the link below :)</p>↵</td>↵</tr>↵<!-- 600px footer -->↵<tr>↵<td class="container-padding" style="background-color: #f7f7f7; padding-left: 30px; padding-right: 30px; font-size: 11px; line-height: 20px; font-family: Arial, Helvetica, sans-serif; color: #666666; border-top: 1px solid #dddddd; border-bottom: 2px solid #0099ff;" align="left" bgcolor="#f7f7f7">↵<p style="float: right; margin-top: 19px;"><a style="text-decoration: none;" href="https://www.facebook.com/cloudchowk" target="_blank"><img src="https://cdn.cloudchowk.com/Images/em/email-f-icon.jpg" alt="" width="35" height="28" border="0" hspace="0" vspace="0" /> </a> <a style="text-decoration: none;" href="https://twitter.com/cloudchowk" target="_blank"><img src="https://cdn.cloudchowk.com/Images/em/email-t-icon.jpg" alt="" width="29" height="28" border="0" hspace="0" vspace="0" /> </a> <a style="text-decoration: none;" href="https://www.linkedin.com/company/cloudchowk-solutions-pvt-ltd-" target="_blank"><img src="https://cdn.cloudchowk.com/Images/em/email-l-icon.jpg" alt="" width="36" height="28" border="0" hspace="0" vspace="0" /> </a></p>↵<p>Have a question? Please write to us at: <a style="color: #0099ff; font-weight: normal; text-decoration: none;" href="mailto:sup...@cloudchowk.com">sup...@cloudchowk.com</a></p>↵<p style="line-height: 12px;">&copy; 2014 cloudchowk Solutions Pvt. Ltd. All rights reserved.</p>↵<!--/ end .footer--></td>↵</tr>↵<!--/ end .header --></tbody>↵</table>↵<!--/600px container --></td>↵</tr>↵</tbody>↵</table>↵<!--/100% wrapper--> <!-- 100% wrapper -->↵<table border="0" width="100%" cellspacing="0" cellpadding="0" bgcolor="#eaeaea">↵<tbody>↵<tr>↵<td align="center" valign="top">↵<table class="columns-container" border="0" cellspacing="0" cellpadding="0">↵<tbody>↵<tr>↵<td class="force-col" style="padding-right: 7px;" valign="top"><!-- ### COLUMN 1 ### -->↵<table class="col-2" border="0" width="260" cellspacing="0" cellpadding="0" align="left">↵<tbody>↵<tr>↵<td style="font-size: 13px; line-height: 20px; font-family: Arial, sans-serif; padding-top: 20px;" align="right" valign="top"><a style="text-decoration: none;" href="https://itunes.apple.com/in/app/cloudchowks-patient-portal/id841272408?mt=8" target="_blank"><img title="Apple App Store Icon" src="https://cdn.cloudchowk.com/Images/em/app-store-icon-1-1.png" alt="" width="179" height="56" border="0" hspace="0" vspace="0" /></a></td>↵</tr>↵</tbody>↵</table>↵</td>↵<td class="force-col" valign="top"><!-- ### COLUMN 2 ### -->↵<table id="last-col-2" class="col-2" border="0" width="260" cellspacing="0" cellpadding="0" align="right">↵<tbody>↵<tr>↵<td style="font-size: 13px; line-height: 20px; font-family: Arial, sans-serif; padding-top: 20px;" align="left" valign="top"><a style="text-decoration: none;" href="https://play.google.com/store/apps/details?id=com.cloudchowk.patient&amp;referrer=utm_source%3Dgoogle%26utm_medium%3Dorganic%26utm_term%3D-https://play.google.com/store/apps/details?id%3Dcom.cloudchowk.patient" target="_blank"><img title="Google App Store Icon" src="https://cdn.cloudchowk.com/Images/em/app-store-icon-2-1.png" alt="" width="166" height="56" border="0" hspace="0" vspace="0" /></a></td>↵</tr>↵</tbody>↵</table>↵</td>↵</tr>↵</tbody>↵</table>↵<!--/600px container --></td>↵</tr>↵</tbody>↵</table>↵<!--/100% wrapper-->↵<table border="0" width="100%" cellspacing="0" cellpadding="0" bgcolor="#eaeaea">↵<tbody>↵<tr>↵<td align="center" valign="top"><br /> <!-- 600px container (white background) -->↵<table class="container" border="0" width="600" cellspacing="0" cellpadding="0" bgcolor="#eaeaea"><!--/ end .header -->↵<tbody>↵<tr>↵<td style="padding-left: 3px; padding-right: 3px; font-size: 11px; line-height: 18px; font-family: Arial, Helvetica, sans-serif; color: #a0a0a0;" align="left">↵<p>Registered office: D-1 Second Floor, Defence Colony, New Delhi - 110024, India. CIN: U72900DL2001PTC110685</p>↵<p>cloudchowk and the cloudchowk logo are either registered trademarks or trademarks of cloudchowk Solutions Pvt. Ltd. in India and/or other countries. All other trademarks are the property of their respective owners.</p>↵<p>Apple, the Apple logo, iPad, and iPhone are trademarks of Apple Inc., registered in the U.S. and other countries. App Store is a service mark of Apple Inc. Google Play&trade; is a trademark of Google Inc.</p>↵<!--/ end .footer--></td>↵</tr>↵</tbody>↵</table>↵<!--/600px container --></td>↵</tr>↵</tbody>↵</table>"
  2. CategoryName: "Password Reset"
  3. CategoryType: "E-Mail Template"
  4. SubCategory: "Doctor"
  5. SubCategoryType: "Password Reset"
  6. Subject: "Reset your cloudchowk password."
  7. TemplateId: "f6e36d38-776c-4d70-b295-769ae91dd577"
  8. TemplateName: "Template 1"
  9. UserRoleId: "93127ac8-7739-4347-8f4f-045a8d129ce3"
  10. __proto__: Object

Can you please help me now?



--

Dheeraj Kumar

unread,
Dec 23, 2014, 7:12:16 AM12/23/14
to ang...@googlegroups.com, Sander Elias
Hi Sander,

Thanks so much for taking the time to help me,your concern motivates me and and finally i am able to solve this problem..
If you would won't help me than might be i am not able yo solve this problem.
I am share my code with u and screen shot Plnkr

Sander Elias

unread,
Dec 23, 2014, 7:48:17 AM12/23/14
to ang...@googlegroups.com, sande...@gmail.com
You did not define current on your scope. I think that's your mayor problem.
a secondary issue is that you are overly complicating things.

I created a small sample with an nested ng-repeat for you, have a look at this: http://plnkr.co/edit/5nLdX1deR4i1chrWWvIL?p=preview

Regards
Sander

Dheeraj Kumar

unread,
Dec 23, 2014, 11:08:31 AM12/23/14
to ang...@googlegroups.com, Sander Elias
Thank you.I got it.
Now i understood nested ng-repeat.i'll try this and hope didn't face any problem.

Regards
Dheeraj Kumar

--

Dheeraj Kumar

unread,
Jan 2, 2015, 7:29:34 AM1/2/15
to ang...@googlegroups.com, Sander Elias
Hi Sander,

Can you please tell me how to generate nested accordions(http://angular-ui.github.io/bootstrap/) using ng-repeat?

Thank you
Dheeraj Kumar

Reply all
Reply to author
Forward
0 new messages