0

The thing that works for me is that I get a button with the html code. But the button isn't styled so it's a plain button without any css characteristics.

Down is the code that should be relevant to primeNg. So my problem is that primeNg isn't styling my components.

edit: Once trying to re run the application I get the error: InvalidConfigError... ensure the file is valid JSON Which is the Style section.

index.html

<link rel="stylesheet" type="text/css" href="/node_modules/primeng/resources/themes/omega/theme.css" />
<link rel="stylesheet" type="text/css" href="/node_modules/primeng/resources/primeng.min.css" />

.angular-cli.json

"styles":{
    "styles.css",
    "../node_modules/font-awesome/css/font-awesome.min.css",
    "../node_modules/primeng/resources/primeng.min.css",
    "../node_modules/primeng/resources/themes/omega/theme.css"

  }

app.component.html

<button pButton type="button" class="ui-button-warning"></button>

app.component.ts

import {ButtonModule} from 'primeng/primeng';

app.module.ts

import { ButtonModule } from 'primeng/primeng';
imports: [
  ButtonModule
]
Amar
  • 509
  • 2
  • 15
  • 36
  • You don't have to import stylesheets in `index.html` when you already stated them in `styles` array. – Haseoh Sep 18 '17 at 07:55
  • did you add primeng styles in angular-cli.json and did you re-run the project. because whenever there is .angular-cli.json it's not affected untill you re run the project. – Chandru Sep 18 '17 at 07:59
  • you can see my angular-cli.json links in my question. "styles":{ "styles.css", "../node_modules/font-awesome/css/font-awesome.min.css", "../node_modules/primeng/resources/primeng.min.css", "../node_modules/primeng/resources/themes/omega/theme.css" } which I've added manually – Amar Sep 18 '17 at 08:02
  • dont have the styles in the index.html – Hash Sep 18 '17 at 08:08
  • Yes but that wouldn't still change anything at all for my problem – Amar Sep 18 '17 at 08:26
  • Edited my question – Amar Sep 18 '17 at 08:33
  • https://stackoverflow.com/questions/38338342/prime-ng-styles-not-applying-angular2 – Vega Sep 18 '17 at 09:08

0 Answers0