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

220
Views
Obtenga y muestre datos de la tabla en angular y laravel

Estoy tratando de mostrar los datos obtenidos de laravel api en el código de la tabla angular:

 public function fetchQuestions(Request $request) { $questions = Questions::where('status',$request->status)->get(); return response()->json($questions, 200); }

código angular:

 questions = []; ... this.http.post(this.baseUrl+'api/auth/question', formData).subscribe(result => { this.questions.push(result);

Esto no muestra ningún dato.

tengo que usar

 this.questions.push(result[0]); this.questions.push(result[1]); .. .. this.questions.push(result[n]);

para enviar todos los datos. ¿Cómo puedo enviar todos los datos de la matriz?

y mostrar datos usando loop

 <ng-container *ngFor="let img of questions; let i=index">
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Actualmente está insertando una matriz en una matriz. Para obtener el resultado que desea, solo debe asignar la matriz de resultados a la matriz de preguntas:

 ...subscribe(result => {this.questions = result})
over 4 years ago · Santiago Trujillo 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!