angular-cdk

mat-menu pierces through “cdk overlay fog”

别来无恙 提交于 2019-12-11 04:07:57
问题 This STACKBLITZ (SB) shows the problem. CSS class .WHYYYYY shows the "two" problems I'm facing. in order for the mat-menu to open on hover I need to set z-index:1050; (ref 2 hacky workaround) on the menu buttons. this creates a problem with the "dialog fog". (click on the button -> SB) I found out the overlay has a default "z-index of 1000" Seems I have two ways of solving this. give the fog a higher z-index (hack the hack) (desired solution) make the hover menu work with normal z-index. I

Angular Material table row (click) event triggered when clicking an action in a cell within that row

醉酒当歌 提交于 2019-12-10 19:33:11
问题 How can you trigger a modal with a button inside a mat-table without triggering the rows (click) event? I've seen and read with Angular Material 2 Table Mat Row Click event also called with button click in Mat Cell however the solution of using $event.stopPropagation() there prevents the modal from being displayed. I followed this https://stackblitz.com/edit/angular-material2-expandable-rows-filter-pagination-sorting?file=app%2Ftable-example.html for the row expansion functionality. Here's a

cdk virtualscroll with mat-grid-list

风流意气都作罢 提交于 2019-12-10 10:28:47
问题 Is there an virtual scroll implementation that works with the grid-list? I think the default implementation won't work because each row should have an element around it. I'm using the grid-list to display profile pictures, and need an infinite scroll or preferably virtual scroll to load new ones. 回答1: So since cdk virtualscroll doesn't support multi column, I ended up using ngx-virtual-scroller, which does support multi-columns. The mat-grid-list I also had to let go because of this, but,

How to implement a global loader in Angular 7.1

▼魔方 西西 提交于 2019-12-06 19:19:07
问题 I have a global loader which is implemented like this: CoreModule: router.events.pipe( filter(x => x instanceof NavigationStart) ).subscribe(() => loaderService.show()); router.events.pipe( filter(x => x instanceof NavigationEnd || x instanceof NavigationCancel || x instanceof NavigationError) ).subscribe(() => loaderService.hide()); LoaderService: @Injectable({ providedIn: 'root' }) export class LoaderService { overlayRef: OverlayRef; componentFactory: ComponentFactory<LoaderComponent>;

cdk virtualscroll with mat-grid-list

假装没事ソ 提交于 2019-12-05 20:12:10
Is there an virtual scroll implementation that works with the grid-list? I think the default implementation won't work because each row should have an element around it. I'm using the grid-list to display profile pictures, and need an infinite scroll or preferably virtual scroll to load new ones. So since cdk virtualscroll doesn't support multi column, I ended up using ngx-virtual-scroller , which does support multi-columns. The mat-grid-list I also had to let go because of this, but, creating your own tiles isn't that much work when using flexbox. Here's a snippet using multi columns, [users

md-table in Angular Material 2

南笙酒味 提交于 2019-12-05 13:45:07
问题 I am working with Angular Material Table. In Html code, there is <ng-container cdkColumnDef="userId"> <md-header-cell *cdkHeaderCellDef> ID </md-header-cell> <md-cell *cdkCellDef="let row"> {{row.id}} </md-cell> </ng-container> I found out that cdkHeaderCellDef and cdkCellDef are from CDK Table I am getting error saying " Can't bind to 'cdkHeaderRowDef' since it isn't a known property of 'md-header-row'. " How can I solve this ? 回答1: The cdkHeaderCellDef and cdkCellDef are part of the

How to implement a global loader in Angular 7.1

你说的曾经没有我的故事 提交于 2019-12-04 23:11:41
I have a global loader which is implemented like this: CoreModule: router.events.pipe( filter(x => x instanceof NavigationStart) ).subscribe(() => loaderService.show()); router.events.pipe( filter(x => x instanceof NavigationEnd || x instanceof NavigationCancel || x instanceof NavigationError) ).subscribe(() => loaderService.hide()); LoaderService: @Injectable({ providedIn: 'root' }) export class LoaderService { overlayRef: OverlayRef; componentFactory: ComponentFactory<LoaderComponent>; componentPortal: ComponentPortal<LoaderComponent>; componentRef: ComponentRef<LoaderComponent>; constructor

Angular 7 Drag and Drop - Dynamically Create Drop Zones

半世苍凉 提交于 2019-12-04 09:13:11
问题 Is there a way to dynamically create drop zones? I'm having some troubles with ngFor and cdkDropList. Here is my first list and draggable elements: <div class="subj-container" cdkDropListOrientation="horizontal" cdkDropList #subjectList="cdkDropList" [cdkDropListData]="subjects" [cdkDropListConnectedTo]="[lessonList]" (cdkDropListDropped)="drop($event)" > <div class="subject" *ngFor="let subject of subjects" cdkDrag> {{subject.name}} </div> </div> And here is my second list: <div class="conta

mat-sort not working on mat-table

Deadly 提交于 2019-12-04 00:22:56
问题 My mat-table is working fine, but when adding mat-sort following the official api documentation, it fails at the ngAfterViewInit with the following message Cannot set property 'sort' of undefined at ViewFeedbackComponent.ngAfterViewInit There is already a SO post on this issue (see following link) Mat-table Sorting Demo not Working but I still am not able to get it working. Does somebody spot the issue? The official example works with a "static" MatTableDataSourcedefined in the component

Add a new row into mat-table using angular 4

好久不见. 提交于 2019-12-03 08:42:14
How to add a new row into Angular Material table manually from a input field. Please see this image in that if i add a state name and state code it should present in the following table please help me how to achieve it using Angular 4. I've put together a quick example that should give you a good hint as to where to start from: Working demo This works by using two-way data binding on the input field to keep track of what the user typed in the form. When the add button is then pressed, the table is updated with a new element dynamically created with the input content. 来源: https://stackoverflow