argon-dashboard-angular icon indicating copy to clipboard operation
argon-dashboard-angular copied to clipboard

Angular material component are not working even after installation

Open Oliverq755 opened this issue 5 years ago • 18 comments
trafficstars

Prerequisites

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

  • [x] I am running the latest version
  • [x] I checked the documentation and found no answer
  • [x] I checked to make sure that this issue has not already been filed
  • [ ] I'm reporting the issue to the correct repository (for multi-repository projects)

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

  • Device: Lenovo Thinkpad
  • Operating System: Ubuntu 19.10
  • Browser and Version: chrome Version 80.0.3987.106 (Official Build) (64-bit)

Output screenshot

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

Oliverq755 avatar May 06 '20 23:05 Oliverq755

I am still waiting for the answers and any workarounds.

Oliverq755 avatar May 08 '20 18:05 Oliverq755

Same problem here...

databill86 avatar Jun 03 '20 16:06 databill86

Sometimes it requires server restart

kmooventhan98 avatar Dec 31 '20 04:12 kmooventhan98

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
 ]

fidoandfido avatar Jul 23 '21 09:07 fidoandfido

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

sudarshan-dev-locusnine avatar Aug 19 '21 09:08 sudarshan-dev-locusnine

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

stajilov avatar Aug 19 '21 21:08 stajilov

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 ]

Kalvino avatar Sep 04 '21 00:09 Kalvino

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

stajilov avatar Sep 06 '21 10:09 stajilov

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

joncampbell0730 avatar Mar 08 '22 19:03 joncampbell0730

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.

ahmediz avatar Mar 13 '22 17:03 ahmediz

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 avatar Mar 28 '22 09:03 jacolaisen

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.

prajjwalag avatar Apr 27 '22 06:04 prajjwalag

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.

votala avatar Jul 14 '22 15:07 votala

Sometimes it requires server restart

this was the answer!!!! Thanks

joseguzmann avatar Jul 30 '22 21:07 joseguzmann

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

nikkkunj avatar Oct 19 '22 12:10 nikkkunj

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.

nikita-fuchs avatar Nov 15 '22 12:11 nikita-fuchs

Same here ;/ with angular 14

Fbisons avatar Nov 29 '22 14:11 Fbisons

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

edoura avatar Dec 28 '22 05:12 edoura