Material design component “is not a known element” in Angular2
It should be <button md-button>foo</button> OR <button md-raised-button>foo</button>
It should be <button md-button>foo</button> OR <button md-raised-button>foo</button>
Use disableRipple as an attribute to disable ripples for the md-tab-group as Angular2+ using the Angular material. Just simply do something like this: <md-tab-group disableRipple></md-tab-group> Also if you are using the latest Angular Material, it’s a little bit different like this below: <mat-tab-group [disableRipple]=”true”></mat-tab-group>
You will get that exact No provider for MatDialogRef error in case you include your dialog’s component html selector in dialog-overview-example.html like <dialog-overview-example-dialog></dialog-overview-example-dialog> There is no need for that, do not include the html selector of the dialog component anywhere.
mdDatepicker provides method open() in order to open it manually doe developers. You can invoke it at md-input‘s focus event. See docs(Method of MatDatepicker). <md-input-container> <input mdInput [mdDatepicker]=”picker” (focus)=”picker.open()” placeholder=”Choose a date”> <button mdSuffix [mdDatepickerToggle]=”picker”></button> </md-input-container> <md-datepicker #picker></md-datepicker> Demo(included demo for opening on focus and opening in typescript)
Newly imported modules need to be added to imports: import { MatButtonModule } from ‘@angular/material/button’ @NgModule{ … imports: [ BrowserModule, BrowserAnimationsModule, MatCardModule, MatDialogModule, MatButtonModule ], … })
Not sure if this will help your situation as there’s no code but we’ve found that the MatTable loads very slowly if a large data set is set before you set the datasource paginator. For example – this takes several seconds to render… dataSource: MatTableDataSource<LocationItem> = new MatTableDataSource(); @ViewChild(MatSort) sort: MatSort; @ViewChild(MatPaginator) paginator: MatPaginator; ngOnInit() … Read more
If you look at Angular Material Demos (button), which is an older version of Angular Material demo, there is a button performing this. This demo used to correspond (it’s now outdated) to the demo on the Angular GitHub page, see: github.com – Angular Material – src/demo-app/button. You can simply use: <button mat-button [disabled]=”isDisabled”> where isDisabled … Read more
To create a disabled FormControl is really simple. 1 – Don’t use disabled attribute in your template; 2 – Instantiate your FormGroup like this: this.formGroup = this.formBuilder.group({ dateJoined: { disabled: true, value: ” } // … }); That being said, although you want to prevent users from typing something in the input, you still want … Read more
Alex is correct. You have to use an ErrorStateMatcher. I had to do a lot of research to figure this out, and there wasn’t a single source that gave me the whole answer. I had to cobble together the information I learned from multiple sources to make my own solution to the problem. Hopefully the … Read more
You can fix this by adding a .mat-tooltip css declaration in you main styles file and change the font size there. You need to set !important on the font size otherwise it won’t show up.