2

I have installed primeFlex(Version 3.0.1) on my angular application(Version 12.1.4). I followed the instructions on their webpage primeflex.com however, was unable to fix the error. I glanced over the network Tab and found that the CSS file was retrieved however it is not being applied to my application. I am not sure how to fix it? Any help is appreciated.

Sulav Dahal
  • 129
  • 3
  • 10
  • Are we supposed to guess how your using the library? Show your code! – R. Richards Aug 11 '21 at 22:20
  • 1
    Never Mind, I fixed it, it was the version issue. Thanks for the help though! – Sulav Dahal Aug 11 '21 at 22:59
  • @SulavDahal, can you elaborate what version issue, because I am facing same issue – Sandip Ghadge Aug 20 '21 at 05:13
  • @SandipGhadge so, when I installed Prime Flex it installed the latest version which was 3.0.1 however while I was following the Prime NG documentation I followed the documentation of Prime Flex V 2.0.0. Prime flex version 3 and version 2 have different CSS classes to style the elements and apply those flex and grids, so that is why it's not working. – Sulav Dahal Aug 20 '21 at 08:45

3 Answers3

19

In primeflex version greater than 3.0.0, the tag "p-" was removed, for example: class="p-grid" became class="grid".

You can notice this by opening the file in your_project/node_modules/primeflex/primeflex.css, you will see that there is no longer the "p-" tag in the classes.

If you want to continue using the tag, I recommend you install primeflex version 2.0.0, changing:

...
"primeflex": "2.0.0",
...

See

Eliel Cena
  • 191
  • 3
1

in primeng doc for angular 12 and above for this date (january 2022) the primeflex versin doc is 2.0 - but it install new version 3+ the docs for primeflex 3+ is https://www.primefaces.org/primeflex/

yehonatan yehezkel
  • 1,116
  • 18
  • 28
0

Angular 12 is not compatible with latest Primeflex version.

Install v2.0 with this command

npm i primeflex@2.0.0 --save

It should fix the issue.

Apostolos
  • 10,033
  • 5
  • 24
  • 39