Get 2024 Templates Mega Bundle!$1000 worth of 19 Bootstrap HTML, Vue & React Templates + 3 Vector Sets for just $99
Get for 99$

Metronic does support Prime-NG plugin


Hi there,
Our team are trying to include powerfull Prime-NG plugin into Metronic template.
However there is seems some error thrown.
We would like to know or share to us how to enable the plugin


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (11)


Hi,

I'm pleased to hear that you were able to identify and resolve the root cause of the issue in your project.

It is okay. Your experience and the steps you've taken may also be helpful to others who encounter similar challenges in the future.

If you have any more questions or need further assistance with any other topics, please feel free to reach out. I'm here to help, and I appreciate your feedback and sharing your experience.



Code image:
<img src="https://i.ibb.co/414g1gh/Screenshot-2023-10-12-at-10-34-40-AM.png" alt="Screenshot-2023-10-12-at-10-34-40-AM" border="0">

Browser element inspector image:
<img src="https://i.ibb.co/w6jcvs4/image.png" alt="image" border="0">

Browser view image:
<img src="https://i.ibb.co/54Bd3jK/image.png" alt="image" border="0">

We have attempted to replicate the issue, and it appears that the button is functioning correctly on the frontend. It's worth noting that in this test, we did not import the style.

Here is the link to the package.json file we used for the test:
https://gist.github.com/KeenthemesHub/3d2e008fa4f3948b8446b61932caf834

Additionally, please find the versions of Node.js and npm that we utilized during the test:

Node.js version: v18.18.0
npm version: 10.2.0

If you have any further issue, please don't hesitate to ask.



hi Faizal,

we found the root cause after several couple of days analysing step by step why the PrimeNG does not work at all.
This is related to the 3rd party plugin js included in angular.json seems it is class not able to call initially as it is overwriting or some other issues.
So what we have done is we are calling the primeNG 1st and then we are calling the plugin ... amazingly now the PrimeNG components that we configured is working greatly !
Thanks for your support and help, sorry for the troublesome..!



The issue remains somewhat unclear for us. To help you troubleshoot and resolve it, here are some general steps you can follow.

First, ensure that you have successfully installed PrimeNG using npm without any errors. You can install it with the following command:

npm install primeng

This command will install the PrimeNG library and its dependencies in your project.


In your Angular module where you intend to use PrimeNG components, make sure you import the specific PrimeNG modules for the components you want to use. For example, if you want to use the PrimeNG Button component, import the ButtonModule like this:

import { ButtonModule } from "primeng/button";

@NgModule({
imports: [
ButtonModule, // Import the ButtonModule here
// ... other modules
],
// ... other module configuration
})
export class YourModule { }

Import the necessary modules for the PrimeNG components you intend to use. This makes the components available for use within your module.

Then, you can use PrimeNG components in your templates as needed. For example, if you imported the ButtonModule, you can use the PrimeNG button component in your HTML templates:


<p-button label="Click me"></p-button>

Make sure you refer to the PrimeNG documentation for specific usage and customization options for each component.



Hi Faizal,

Thanks for the reply.
Fyi, we have tried exactly same steps as above for several times.
Indeed still same issue.
I would rather suggest if you try from your end if it works or not.



Hi,

Could you kindly provide more details about when this error occurred? Was it encountered during the installation process? Additionally, are there any other error messages that you have observed? This information would be helpful.

Thanks



Hi Faizal,

this error occurred while installing the prime ng.
it is basic installation though.
Above is the error that i have already attached.
Our team eagerly waiting for the remedy.



Could you please clarify when exactly you received this error? Did it occur during the installation process?

One possible cause of this error is outdated type definition files (.d.ts) for third-party libraries. To address this issue, you can check if there are updates available for the PrimeNG type definitions and update them using npm with the following command:

npm install @types/primeng


Make sure you are using a compatible version of the Angular CLI. You can check for updates to the CLI and update it using npm if needed.

npm install -g @angular/cli



hi faizal,


Angular CLI: 16.2.4
Node: 18.17.0
Package Manager: npm 10.1.0
OS: darwin x64

Angular: 16.2.7
... animations, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic, router

Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1602.4
@angular-devkit/build-angular 16.2.4
@angular-devkit/core 16.2.4
@angular-devkit/schematics 16.2.4
@angular/cdk 15.2.9
@angular/cli 16.2.4
@angular/material 15.2.9
@schematics/angular 16.2.4
rxjs 7.8.1
typescript 4.9.5
webpack 5.88.2
zone.js 0.13.3


im using the latest version of cli.
and the above


npm install @types/primeng


is not working..npm throw error not found



It would be helpful if you could provide a screenshot of the error message or any details about the error that you're seeing. This will give us understanding of the issue you're facing.

Feel free to share the screenshot or describe the error message, and we'll do our best to help you resolve the problem.



here you go, as the basic setup from the Prime-NG official website installation done in Metronic8


Error: node_modules/primeng/api/shared.d.ts:19:81 - error TS2344: Type "{ type: { alias: "type"; required: false; }; name: { alias: "pTemplate"; required: false; }; }" does not satisfy the constraint "{ [key: string]: string; }".
Property ""type"" is incompatible with index signature.
Type "{ alias: "type"; required: false; }" is not assignable to type "string".

19 static &Eacute;&micro;dir: i0.&Eacute;&micro;&Eacute;&micro;DirectiveDeclaration<PrimeTemplate, "[pTemplate]", never, { "type": { "alias": "type"; "required": false; }; "name": { "alias": "pTemplate"; "required": false; }; }, {}, never, never, false, never>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Error: node_modules/primeng/baseicon/baseicon.d.ts:13:77 - error TS2344: Type "{ label: { alias: "label"; required: false; }; spin: { alias: "spin"; required: false; }; styleClass: { alias: "styleClass"; required: false; }; }" does not satisfy the constraint "{ [key: string]: string; }".
Property ""label"" is incompatible with index signature.
Type "{ alias: "label"; required: false; }" is not assignable to type "string".

13 static &Eacute;&micro;cmp: i0.&Eacute;&micro;&Eacute;&micro;ComponentDeclaration<BaseIcon, "ng-component", never, { "label": { "alias": "label"; "required": false; }; "spin": { "alias": "spin"; "required": false; }; "styleClass": { "alias": "styleClass"; "required": false; }; }, {}, never, ["*"], true, never>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Error: node_modules/primeng/button/button.d.ts:62:81 - error TS2344: Type "{ iconPos: { alias: "iconPos"; required: false; }; loadingIcon: { alias: "loadingIcon"; required: false; }; label: { alias: "label"; required: false; }; icon: { alias: "icon"; required: false; }; loading: { ...; }; }" does not satisfy the constraint "{ [key: string]: string; }".
Property ""iconPos"" is incompatible with index signature.
Type "{ alias: "iconPos"; required: false; }" is not assignable to type "string".

62 static &Eacute;&micro;dir: i0.&Eacute;&micro;&Eacute;&micro;DirectiveDeclaration<ButtonDirective, "[pButton]", never, { "iconPos": { "alias": "iconPos"; "required": false; }; "loadingIcon": { "alias": "loadingIcon"; "required": false; }; "label": { "alias": "label"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; }, {}, never, never, false, never>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Error: node_modules/primeng/button/button.d.ts:178:71 - error TS2344: Type "{ type: { alias: "type"; required: false; }; iconPos: { alias: "iconPos"; required: false; }; icon: { alias: "icon"; required: false; }; badge: { alias: "badge"; required: false; }; label: { alias: "label"; required: false; }; ... 6 more ...; ariaLabel: { ...; }; }" does not satisfy the constraint "{ [key: string]: string; }".
Property ""type"" is incompatible with index signature.
Type "{ alias: "type"; required: false; }" is not assignable to type "string".

178 static &Eacute;&micro;cmp: i0.&Eacute;&micro;&Eacute;&micro;ComponentDeclaration<Button, "p-button", never, { "type": { "alias": "type"; "required": false; }; "iconPos": { "alias": "iconPos"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "badge": { "alias": "badge"; "required": false; }; "label": { "alias": "label"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "loadingIcon": { "alias": "loadingIcon"; "required": false; }; "style": { "alias": "style"; "required": false; }; "styleClass": { "alias": "styleClass"; "required": false; }; "badgeClass": { "alias": "badgeClass"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; }, { "onClick": "onClick"; "onFocus": "onFocus"; "onBlur": "onBlur"; }, ["templates"], ["*"], false, never>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(