Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular material component are not working even after installation #12

Open
3 of 4 tasks
Oliverq755 opened this issue May 6, 2020 · 18 comments
Open
3 of 4 tasks

Comments

@Oliverq755
Copy link

Oliverq755 commented May 6, 2020

Prerequisites

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

  • I am running the latest version
  • I checked the documentation and found no answer
  • 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
Copy link
Author

I am still waiting for the answers and any workarounds.

@databill86
Copy link

Same problem here...

@kmooventhan98
Copy link

Sometimes it requires server restart

@fidoandfido
Copy link

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

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

@stajilov
Copy link

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

@Kalvino
Copy link

Kalvino commented Sep 4, 2021

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
Copy link

stajilov commented Sep 6, 2021

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
Copy link

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
Copy link

ahmediz commented Mar 13, 2022

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
Copy link

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
Copy link

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
Copy link

votala commented Jul 14, 2022

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
Copy link

Sometimes it requires server restart

this was the answer!!!! Thanks

@nikkkunj
Copy link

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
Copy link

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
Copy link

Fbisons commented Nov 29, 2022

Same here ;/ with angular 14

@edoura
Copy link

edoura commented Dec 28, 2022

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>

👍
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests