angular-material

Angular 6 MatTable Performance in 1000 rows.

萝らか妹 提交于 2019-12-18 03:12:23
问题 I'm using angular material in my project and I'm using Mat-Table to render 1000 Product/row per table. When Change pagination (we use backend pagination) of table to 1000 rows the performance become very slow I even can't write in textboxes. I tried to debug the issue so I put logs on one column template so I can see how's render works. I see it's Rerender all rows even if I hover on the table headers. Is there's any possibilities to control the change detection to be like

Angular matSort not working

时间秒杀一切 提交于 2019-12-18 03:06:34
问题 I'm having trouble with importing matSort into my matTable. I'm providing you with my code: dashboard.component.ts import {Component, ViewChild} from '@angular/core'; import {UserService} from "../user.service"; import {DohvatMantisaService} from "../dohvat-mantisa.service"; import {Mantisi} from "../Mantisi"; import {Observable} from "rxjs/Observable"; import {DataSource} from "@angular/cdk/collections"; import 'rxjs/add/observable/of'; import 'rxjs/add/operator/startWith'; import 'rxjs/add

Get Material 2 theme color scheme/palette for other elements

泄露秘密 提交于 2019-12-17 22:35:37
问题 I am building an application but I want to keep a consistent color scheme that can be changed with settings so im using Material (2) with angular(2+), but I am not sure how to get the color scheme on elements that dont directly offer the ability to color them with color="primary" so im left with trying to figure out how to obtain the color/color scheme that my Material 2 theme uses. And i want it to change when the theme changes, for instance my navbar will adapt to the theme change because

Angular Material mat-table Row Grouping

孤人 提交于 2019-12-17 16:08:58
问题 Leaving aside the libraries that provide row grouping for their particular tables, I am trying to implement such a feature on Angular Material 2 mat-table which does not come with such a feature. Items to populate the table: export class BasketItem{ public id: number; public position: number; public quantity: number; public groupId: number; } Grouping rows that have same groupId property in the following table <mat-table class="mat-elevation-z8" [dataSource]="dataSource" multiTemplateDataRows

How to translate mat-paginator in Angular 4?

孤人 提交于 2019-12-17 15:54:11
问题 Do you have any ideas how can I translate "Items per page" in Angular's mat-paginator tag? The mat-paginator is an element from Material Design. 回答1: You can use the MatPaginatorIntl for this. Will Showell made an example that no longer works, so here is an updated version (with Dutch) and step-by-step guidance. Import the MatPaginatorIntl from @angular/material into your application. Create a new paginator file for your locale (in this example I use Dutch) and import that: import {

Template parse errors: 'md-form-field' is not a known element

六眼飞鱼酱① 提交于 2019-12-17 15:46:37
问题 I am using Angular 4 and Angular Material 2. For the following code : <form> <md-form-field> <input mdInput [ngModel]="userName" placeholder="User" [formControl]="usernameFormControl"> <md-error *ngIf="usernameFormControl.hasError('required')"> This is <strong>required</strong> </md-error> <input mdInput [ngModel]="password" placeholder="Password" [formControl]="passwordFormControl"> <md-error *ngIf="passwordFormControl.hasError('required')"> This is <strong>required</strong> </md-error>

Expandable table rows in angular 4 with angular material

醉酒当歌 提交于 2019-12-17 07:06:29
问题 How would you make rows expandable in angular material tables? One requirement is that I need to be using the angular material table. I would also prefer to use the material accordion to the information provided here. I want to click on row and show different information for each column. Im looking for something like below. If you click on row 1, rows 2 and 3 appear with different data. 回答1: As mentioned here by Andrew Seguin this is already feasible out of the box: using the when predicate.

How to import Angular Material in project?

雨燕双飞 提交于 2019-12-17 06:31:29
问题 I have installed Angular Material Design. Now I try to add this in app.module.ts file: import { MaterialModule } from '@angular/material'; What I should decify in section: imports: [] ? that to load all material entities. I tried: imports: ['MaterialModule'] but it is deprecated 回答1: MaterialModule was depreciated in version 2.0.0-beta.3 and it has been removed completely in version 2.0.0-beta.11. See this CHANGELOG for more details. Please go through the breaking changes. Breaking changes

How to import Angular Material in project?

家住魔仙堡 提交于 2019-12-17 06:31:00
问题 I have installed Angular Material Design. Now I try to add this in app.module.ts file: import { MaterialModule } from '@angular/material'; What I should decify in section: imports: [] ? that to load all material entities. I tried: imports: ['MaterialModule'] but it is deprecated 回答1: MaterialModule was depreciated in version 2.0.0-beta.3 and it has been removed completely in version 2.0.0-beta.11. See this CHANGELOG for more details. Please go through the breaking changes. Breaking changes

Confirm password validation in Angular 6

你说的曾经没有我的故事 提交于 2019-12-17 04:59:27
问题 I want to perform password and confirm password validations using material components only,and an error message below the confirm password field if confirm password field doesn't match And if it is empty .Tried many resources unable to achieve. Tried this video too. This is the material component i am looking for HTML <mat-form-field > <input matInput placeholder="New password" [type]="hide ? 'password' : 'text'" [formControl]="passFormControl" required> <mat-icon matSuffix (click)="hide =