Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Every component don't work #13614

Closed
pigisfre opened this issue Sep 5, 2023 · 6 comments
Closed

Every component don't work #13614

pigisfre opened this issue Sep 5, 2023 · 6 comments
Labels
Resolution: Needs More Information More information about the issue is needed to find a correct solution Resolution: Wontfix Issue will not be fixed due to technical limitations

Comments

@pigisfre
Copy link

pigisfre commented Sep 5, 2023

Describe the bug

For every component of prime ng I get this error.
`Error: src/app/dashboard/vehicle/vehicle/vehicle.component.html:4:5 - error NG8001: 'p-button' is not a known element:

  1. If 'p-button' is an Angular component, then verify that it is part of this module.
  2. If 'p-button' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

4
~~~~~~~~~~~~~~~~~~~~~~~~

src/app/dashboard/vehicle/vehicle/vehicle.component.ts:9:16
9 templateUrl: './vehicle.component.html',
~~~~~~~~~~~~~~~~~~~~~~~~~~
Error occurs in the template of component VehicleComponent.

** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/
**

× Failed to compile.`

I am using the latest version of angular and prime ng.

Environment

Windows 10, Visual studio.

Reproducer

No response

Angular version

16.1.7

PrimeNG version

16.1.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

9.6.7

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

@pigisfre pigisfre added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Sep 5, 2023
@SoyDiego
Copy link
Contributor

SoyDiego commented Sep 5, 2023

You need to add the Module that integrate the component that you want to use.
In your error message you need to add ButtonModule

@pigisfre
Copy link
Author

pigisfre commented Sep 5, 2023

@SoyDiego I inserted the ButtonModule but it still doesn't work

@SoyDiego
Copy link
Contributor

SoyDiego commented Sep 5, 2023

@SoyDiego I inserted the ButtonModule but it still doesn't work

Share a stackblitz, like this is impossible help you.
And it's not problem of PrimeNG, PrimeNG works ok, you are not importing the modules in the correct way

@pigisfre
Copy link
Author

pigisfre commented Sep 5, 2023

`import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { VehicleComponent } from './vehicle/vehicle.component';
import { VehicleRoutingModule } from './vehicle-routing.module';
import { TableModule } from 'primeng/table';
import { ButtonModule } from 'primeng/button';

@NgModule({
declarations: [
VehicleComponent
],
imports: [
CommonModule,
VehicleRoutingModule,
TableModule,
ButtonModule

],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class VehicleModule { }
`

@pigisfre
Copy link
Author

pigisfre commented Sep 5, 2023

`import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { VehicleComponent } from './vehicle/vehicle.component';

const routes: Routes = [
{path : '', redirectTo: 'dashboard/vehicle/', pathMatch: 'full'},
{path : '', component: VehicleComponent}
];

@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class VehicleRoutingModule { }
`

@pigisfre
Copy link
Author

pigisfre commented Sep 5, 2023

This is vehicle.component.html belongs to vehicle.module
<p-button label="Check"></p-button>

@cetincakiroglu cetincakiroglu added Resolution: Wontfix Issue will not be fixed due to technical limitations Resolution: Needs More Information More information about the issue is needed to find a correct solution and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Needs More Information More information about the issue is needed to find a correct solution Resolution: Wontfix Issue will not be fixed due to technical limitations
Projects
None yet
Development

No branches or pull requests

3 participants