I tried:
and some other articles and stackoverflow posts with no luck on getting the latest PrimeNG 6+ to work with the latest JHipster 5+. It mostly works, but the styles are a bit off - mainly it seems like primeicons aren't working.
For example, I tried the primeng filter table example and it mostly works except the icons such as the dropdown arrows appear as empty boxes as well as others not appearing correctly. I suspect this may have to do with primeicons not importing correctly?
Has anyone got this to work? I tested using a fresh install of everything but I can post code if really needed.
Sorry guys it's working for me, I just got tripped up on using generator-jhipster-primeng
which doesn't work out of the box. Steps here mostly work, just have to include primeicons. I included full directions below anyways.
However, the layout/css styles are still somewhat off (maybe they conflict with JHipster/bootstrap) and you'll have to tweak some of the official PrimeNG examples, such as using <fa-icon>
instead of old <i>
style icons.
Steps to integrate PrimeNG into JHipster project:
yarn add primeicons primeng @angular/animations
In vendor.css
(or vendor.scss
if you use Sass) add:
@import '~primeicons/primeicons.css';
@import '~primeng/resources/themes/nova-light/theme.css'; // pick whatever theme
@import '~primeng/resources/primeng.min.css'
node_modules/primeng/resources/themes
BrowserAnimationsModule
to app.module.ts
but you may be able to just add it where needed:
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
BrowserAnimationsModule
to @NgModule
imports array as well And that's it! Now follow PrimeNG docs for using specific components.
Tested with jhipster 5.2.1
, primeng 6.1.2
, and primeicons 1.0.0-beta.10
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.