prgrm
prgrm

Reputation: 3833

Importing MatButtonModule does nothing

I am building an Angular app using the Material library.

I want to use the material button module package.

I import it in app.module.ts like this (abbreviated example):

import { MatTableModule } from '@angular/material/table';
import { MatCheckboxModule } from '@angular/material/checkbox';
import { MatButtonModule } from '@angular/material/button';

...

  imports: [
MatTableModule,
MatCheckboxModule,
MatButtonModule,
],

Now, when I go to home.component.html I get Material Tables and Checkboxes to work just fine.

My IDE also detects the rest of the Material modules automaticly. But for some reason the Material Button just does not exist for it.

<mat-table></mat-table> //works
<mat-checkbox></mat-checkbox> //works
<mat-button></mat-button> //does not work

Am I missing something here?

I am using Angular 9.0.3 and Material 9.1.0

Upvotes: 0

Views: 871

Answers (1)

BartoszTermena
BartoszTermena

Reputation: 1487

Material button is a directive, so selector looks like:

button[mat-button] 

Try change your code to <button mat-button>Basic</button>

https://material.angular.io/components/button/api

Upvotes: 2

Related Questions