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

414
Views
El elemento 'jhi-product-list' de coincidencia de directivas o componentes angulares está fuera del alcance del módulo angular actual

Tengo 2 componentes, el componente Inicio, que es el componente Lista de productos de la página de inicio, que me mostrará una lista de productos.

Pregunta: Cuando trato de agregar un selector de lista de productos a home.component.html, aparece este error: El componente Angular o el elemento "jhi-product-list" que coincide con la directiva está fuera del alcance del módulo Angular actual

lista-de-productos.component.ts

 import { Component, OnInit } from '@angular/core'; import {ProductService} from "../services/product.service"; import {Product} from "../entities/product"; @Component({ selector: 'jhi-product-list', templateUrl: './product-list.component.html', styleUrls: ['./product-list.component.scss'] }) export class ProductListComponent implements OnInit { products! : Product[]; constructor(private productService : ProductService) { } ngOnInit(): void { this.listProducts(); } listProducts(){ this.productService.getProductList().subscribe( data => { this.products = data; } ) } }

lista-de-productos.componente.html

 <p *ngFor="let tempProduct for products"> {{tempProduct.name}}: {{tempProduct.unitPrice | currency:'USD'}} </p>

Inicio.componente.html

 <div class="row"> <jhi-product-list> </jhi-product-list> </div>

Y gracias.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Debe agregar 'CUSTOM_ELEMENTS_SCHEMA' a '@NgModule.schemas' de este componente y declarar ese componente en un módulo como este:

 import { ProductListComponent } from './product-list/product-list.component'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; @NgModule({ declarations: [ProductListComponent], schemas: [CUSTOM_ELEMENTS_SCHEMA], }) export class ProductListModule {}
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!