Angular Material 2 Table Mat Row Click event also called with button click in Mat Cell

I’ve just had the same issue and have solved it using Will’s comment to the original post, adding a click handler with $event.stopPropagation to the cell as the direct parent to the button. I’ll add it here as a solution in case anyone else comes here looking for the same answer. I have a Material … Read more

Angular 7 Drag and Drop – Dynamically Create Drop Zones

After a full day of research, I found this pull request on Angular CDK repository on Github. Now, since I did not know how to integrate cdkDropListGroup into my example, I decited to create an array of IDs which will be added to [cdkDropListConnectedTo]. Each instance of my second list will have generated ID, and … Read more

How to use Angular7 (angular material) drag drop between two components

You may use properties id and cdkDropListConnectedTo to link both lists: Component 1: <div cdkDropList id=”list-1″ cdkDropListConnectedTo=”list-2″ (cdkDropListDropped)=”drop($event)”> <div *ngFor=”let item of list” cdkDrag>{{ item }}</div> </div> Component 2: <div cdkDropList id=”list-2″ cdkDropListConnectedTo=”list-1″ (cdkDropListDropped)=”drop($event)”> <div *ngFor=”let item of list” cdkDrag>{{ item }}</div> </div> If you need to connect several lists to one list, you may … Read more

custom filter in mat-table

I found the solution here. It’s necessary to rewrite filterPredicate, and just use it as usual, filterPredicate needs to return true when filter passes and false when it doesn’t export interface Element { name: string; position: number; weight: number; symbol: string; } dataSource = new MatTableDataSource(ELEMENT_DATA); /* configure filter */ this.dataSource.filterPredicate = (data: Element, filter: … Read more

Angular 6 MatTable Performance in 1000 rows

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

What is `cdk` in Angular Material 2 components

CDK is the short form of component dev kit. This signifies that these are general-purpose tools for building components that are not coupled to Material Design From the material2 changelog Several components in core/, such as Overlay, have had their prefix changed to cdk- (short for “component dev kit”). This signifies that these are general-purpose … Read more

tech