Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

278
Views
How to get all module from subModule, using *ngFor loop in angular

TS-code:

modules is an array of objects, which itself contain a nested array of object.

const modules =[{ 
   id: 1,
   module: 'Training Module',
   subModules: [{
        id: 2,
        module: 'Group Creation'
      }, {
        id: 3,
        module: 'Sub Group Creation'
      }, {
        id: 4,
        module: 'Training'
      }, {
        id: 5,
        module: 'Daily Attendance'
      }
    ]
}];

HTML-code:

<tr *ngFor="let module of modules">
  <td>{{ item.subModules[0].module }}</td>    <!-- giving Group Creation -->     
</tr>

Expected Output image description here

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

You can use a virtual container, if you do not want to add an additional element, like this:

<tr *ngFor="let module of modules">
  <td>
    <ng-container *ngFor="let subModule of item.subModules">
      {{ subModule.module }} 
    </ng-container>
  </td>
</tr>

Alternatively, you could create a pipe, that formats the names of your submodules by for example comma separation.

about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!