creativetimofficial / argon-dashboard-angular

MIT License
183 stars 556 forks source link

Angular material component are not working even after installation #12

Open Oliverq755 opened 4 years ago

Oliverq755 commented 4 years ago

Prerequisites

Angular material is not working after installing it to the free version of the argon-angular-dashboard screenshot attached.

Expected Behavior

The expected result should include:

Current Behavior

The current behavior includes only the styles of argon-angular-dashboard. It has all the dependencies installed, however, it doesn't show the styles of Angular material

Steps to Reproduce

In order to replicate this issue, follow the following steps:

  1. Download the free version of argon-angular-dashboard
  2. Add dependencies of angular material by using ng add @angular/material
  3. Add @import "~@angular/material/prebuilt-themes/indigo-pink.css"; in your styles.scss
  4. Add any component in your HTML component, for example, let take a button. <button mat-raised-button color="accent">Accent</button>
  5. Check the output on your page.

Context

Output screenshot

Screenshot from 2020-05-05 18-34-23 (1)

Oliverq755 commented 4 years ago

I am still waiting for the answers and any workarounds.

databill86 commented 4 years ago

Same problem here...

kmooventhan98 commented 3 years ago

Sometimes it requires server restart

fidoandfido commented 3 years ago

Have you imported MatButtonModule into app.module.ts?

import { MatButtonModule } from '@angular/material/button';

Then:


@NgModule({
  declarations: [
  <<SNIP>>
  ],
  imports: [
    HttpClientModule,
    MatFormFieldModule,
    MatInputModule,
    MatButtonModule,
    MatIconModule,
   <<snuo
 ]
sudarshan-dev-locusnine commented 3 years ago

Im also facing the same issue, but it's rendering not native an not mat-raised -button, something in between

stajilov commented 3 years ago

Facing the same issue, styles are not loaded, though I’m getting proper html and functionality 😾

Kalvino commented 3 years ago

Ensure you have imported all your required modules;

e.g mat-form-field input should have 'matInput' and import {MatInputModule} from '@angular/material/input';

For mat buttons; import {MatButtonModule} from '@angular/material/button'; then add to your module imports

imports: [ MatInputModule, MatButtonModule ]

stajilov commented 3 years ago

Solved the issue, in my case, I had to import the modules in the app component, cause was using some of the components directly in the app-component

joncampbell0730 commented 2 years ago

Ive followed the material get started several times and none of my material imports are working at all. Ive added the import to my app.module and added it to the import list and still nothing. please someone help

ahmediz commented 2 years ago

Ive followed the material get started several times and none of my material imports are working at all. Ive added the import to my app.module and added it to the import list and still nothing. please someone help

same here.

jacolaisen commented 2 years ago

Ive followed the material get started several times and none of my material imports are working at all. Ive added the import to my app.module and added it to the import list and still nothing. please someone help

Same here

prajjwalag commented 2 years ago

I was facing the same issue, but after following his instructions @kmooventhan98 and restarted my server, and its working fine.

So anyone who is facing this issue can restart the server and try.

votala commented 2 years ago

I think usage of Material components changed single Module implementation to reduce bundle size after compile., all the components of Material should be imported in specific module where the component is used.

In your case @fidoandfido 's answer would work.

joseguzmann commented 2 years ago

Sometimes it requires server restart

this was the answer!!!! Thanks

nikkkunj commented 2 years ago

I believe If we have a submodule then this happens, instead of importing it to app-module import it into your intermediate module.

nikita-fuchs commented 1 year ago

Same issue here since upgrade from material design 13 to 14, it's simply not rendering anymore. it's imported in every module, but no chance.

Thank god with Angular 15 we won't have this module bogus anymore.

Fbisons commented 1 year ago

Same here ;/ with angular 14

edoura commented 1 year ago

Solved the issue, in my case, I had to import the modules in the app component, cause was using some of the components directly in the app-component

image

here also solved it this way. importing the MatButtonModule in the component which you are using in the template

<button mat-raised-button color="accent">sign up</button>

:+1: image