angular 5 material – form fields stuck at 180px
can you try using mat-form-field { width: 100%; } I had the same issue in a mat-card, this worked for me.
can you try using mat-form-field { width: 100%; } I had the same issue in a mat-card, this worked for me.
You should add the ngDefaultControl attribute to your input like this: <md-input [(ngModel)]=”recipient” name=”recipient” placeholder=”Name” class=”col-sm-4″ (blur)=”addRecipient(recipient)” ngDefaultControl> </md-input> Taken from comments in this post: angular2 rc.5 custom input, No value accessor for form control with unspecified name Note: For later versions of @angular/material: Nowadays you should instead write: <md-input-container> <input mdInput [(ngModel)]=”recipient” name=”recipient” placeholder=”Name” … Read more
Update for Newer Material Version (md –> mat): html: <!– Add the highlight class in row definiton of md-table –> <!– Add click event to pass the selected row index –> <mat-row *cdkRowDef=”let row; columns: displayedColumns;” [ngClass]=”{‘highlight’: selectedRowIndex == row.id}” (click)=”highlight(row)”> </mat-row> Original Answer: You can do it by using ngClass and a flag like … Read more
You just add (click) = “$event.stopPropagation()” to the parent element of these calendars. Like below, <mat-menu class=”date-range-menu” #dateTimeMenu=”matMenu”> <div fxLayout=”row”> <div fxLayout=”column” (click)=”$event.stopPropagation();”> <b>From</b> <mat-calendar></mat-calendar> </div> <div fxLayout=”column” (click)=”$event.stopPropagation();”> <b>To</b> <mat-calendar></mat-calendar> </div> </div> </mat-menu> Stackblitz demo.
Angular < V15 You have to use the panelClass option (since v6) to apply classes on a snackbar like this: this.snackBar.open(message, action, { duration: 2000, panelClass: [‘blue-snackbar’] }); CSS (in global styles.scss): .blue-snackbar { background: #2196F3; } See the Stackblitz example Angular >= v15 The Angular team did add global css variable So you still … Read more
Full disclosure: I work on Material Components for the web, so my opinion may be a bit biased 🙂 TL;DR use whichever library helps you build your UI in the most efficient way possible, or use them side-by-side. Check out our angular2 integration example angular-mdc-web to see how to wrap a MDC-Web component using ng2. … Read more
With the latest update you should use the diameter property: <mat-spinner [diameter]=”70″></mat-spinner> The diameter represents the amount of pixels for both the width and the height of the spinner. In this case it has a size of 70×70 pixels. See the following stackblitz example:
You can have a datetime picker when using matInput with type datetime-local like so: <mat-form-field> <input matInput type=”datetime-local” placeholder=”start date”> </mat-form-field> You can click on each part of the placeholder to set the day, month, year, hours,minutes and whether its AM or PM.
Can you add index to let element; let i = index;” as you’d do with *ngFor? <mat-row *matRowDef=”let row; columns: displayedColumns; let i = index”></mat-row> Or like so: <ng-container matColumnDef=”index”> <mat-header-cell *matHeaderCellDef> Index </mat-header-cell> <mat-cell *matCellDef=”let element; let i = index;”>{{i}}</mat-cell> </ng-container> Working Example: https://stackblitz.com/edit/angular-acdxje?file=app/table-basic-example.html
Just add the <mat-icon> inside mat-button or mat-raised-button. See the example below. Note that I am using material icon instead of your svg for demo purpose: <button mat-button> <mat-icon>mic</mat-icon> Start Recording </button> OR <button mat-raised-button color=”accent”> <mat-icon>mic</mat-icon> Start Recording </button> Here is a link to stackblitz demo.