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

154
Views
¿Cómo imprimir la matriz de elementos en Angular 12 y Typescript?

No puedo mostrar la matriz de valores de los elementos en la página html.

He seleccionado valores de la matriz de objetos json, de este resultado eliminé los valores de categoría duplicados y esos valores se convirtieron en una matriz de cadena. y enumeré esa matriz de elemento. Pero no sé mostrar el elemento forEach en un bucle ngFor en angular.

 export class PreviewComponent implements OnInit { public menus : any = []; newuniq: any[][]; ngOnInit() { this.newmenuService.getProducts() .subscribe(resp=>{ this.menus = resp; console.log("cart",this.menus) }) const newuniq = [...new Set(this.menus.map(item => item.category ))]; newuniq.forEach(function(element) { console.log("element",element); }); }

componente.html {{newuniq}}

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

 <div *ngFor="let item of newuniq"> {{item.category}} </div>

about 4 years ago · Juan Pablo Isaza 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!