angular-material

How do I add a custom column to angular material table?

笑着哭i 提交于 2020-03-03 10:11:58
问题 Currently, I have 4 columns in my data source. I want to perform some operations from the data I receive from one of the columns, and then add that data to a new column in the table. Is there any way to do that? 回答1: You could make changes in data before setting it to dataSource. For example, if you get some http data as observable, you could do: this.data$ = this.certificateService.certificates$.pipe( map(data => { data.column5 = data.column4 // and make all other calculations return data; }

How do I add a custom column to angular material table?

风格不统一 提交于 2020-03-03 10:03:49
问题 Currently, I have 4 columns in my data source. I want to perform some operations from the data I receive from one of the columns, and then add that data to a new column in the table. Is there any way to do that? 回答1: You could make changes in data before setting it to dataSource. For example, if you get some http data as observable, you could do: this.data$ = this.certificateService.certificates$.pipe( map(data => { data.column5 = data.column4 // and make all other calculations return data; }

angular + firebase auth + material = router crashes

人走茶凉 提交于 2020-03-03 02:49:50
问题 The router is not working properly after firebase authentication. The problem is comming from @angular/animations, both importing NoopAnimationsModule or BrowserAnimationsModule the router doesn't work properly package.json "dependencies": { "@angular/animations": "^5.2.8", "@angular/cdk": "^5.2.4", "@angular/common": "^5.2.0", "@angular/compiler": "^5.2.0", "@angular/core": "^5.2.0", "@angular/forms": "^5.2.0", "@angular/http": "^5.2.0", "@angular/material": "^5.2.4", "@angular/platform

angular + firebase auth + material = router crashes

那年仲夏 提交于 2020-03-03 02:49:45
问题 The router is not working properly after firebase authentication. The problem is comming from @angular/animations, both importing NoopAnimationsModule or BrowserAnimationsModule the router doesn't work properly package.json "dependencies": { "@angular/animations": "^5.2.8", "@angular/cdk": "^5.2.4", "@angular/common": "^5.2.0", "@angular/compiler": "^5.2.0", "@angular/core": "^5.2.0", "@angular/forms": "^5.2.0", "@angular/http": "^5.2.0", "@angular/material": "^5.2.4", "@angular/platform

Problems with *ngFor and MatDialog in Angular

北城余情 提交于 2020-03-02 11:52:39
问题 I'm currently building an Angular website. I create several components using a *ngFor loop. The created components each have a mouse event with which a MatDialog should be opened (MatDialog). The problem is that the dialog does not open properly and the buttons inside do not work. However, as soon as I remove the *ngFor loop and only represent the first element, the dialog works perfectly. Does anyone know this problem and how to fix it or an alternative to the *ngFor loop? Does not function:

Problems with *ngFor and MatDialog in Angular

こ雲淡風輕ζ 提交于 2020-03-02 11:52:03
问题 I'm currently building an Angular website. I create several components using a *ngFor loop. The created components each have a mouse event with which a MatDialog should be opened (MatDialog). The problem is that the dialog does not open properly and the buttons inside do not work. However, as soon as I remove the *ngFor loop and only represent the first element, the dialog works perfectly. Does anyone know this problem and how to fix it or an alternative to the *ngFor loop? Does not function:

Angular Material Datepicker set min programmatically

生来就可爱ヽ(ⅴ<●) 提交于 2020-03-02 11:04:50
问题 I am trying to set the min value of the second datepicker if i change the first datepicker, but i can't make it: I got these two datepicker <mat-form-field> <span *ngIf="item.type=='date' && item.hijoDate"> <input matInput [id]="item.key" [matDatepicker]="picker" [min]="minDatePadre" [max]="maxDatePadre" (dateChange)="seleccionaFecha($event, 'padre', item.hijoDate)" readonly [placeholder]="item.label" [formControlName]="item.key"> <mat-datepicker-toggle matSuffix [for]="picker"></mat

Angular Material Date-Picker is not working properly

拥有回忆 提交于 2020-03-02 09:29:52
问题 I am trying to get date using Angular Material datepicker as mentioned bellow, In html <mat-form-field> <mat-label>Custom calendar color</mat-label> <input matInput [matDatepicker]="picker2"> <mat-datepicker-toggle matSuffix [for]="picker2"></mat-datepicker-toggle> <mat-datepicker #picker2 color="primary"></mat-datepicker> </mat-form-field> In app.module.ts import { MatDatepickerModule } from '@angular/material/datepicker'; import { MatNativeDateModule } from '@angular/material'; imports: [

error TS1086: An accessor cannot be declared in an ambient context in Angular 9

会有一股神秘感。 提交于 2020-02-29 20:16:06
问题 I'm learning Angular Material and I'm getting this error when importing { MatButtonModule } from "@angular/material/button". From what I read in other answers, it looks like package compatibility issues but I couldn't fix it. Here's the full error ERROR in node_modules/@angular/cdk/a11y/focus-trap/focus-trap.d.ts(29,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@angular/cdk/a11y/focus-trap/focus-trap.d.ts(30,9): error TS1086: An accessor cannot be

error TS1086: An accessor cannot be declared in an ambient context in Angular 9

ⅰ亾dé卋堺 提交于 2020-02-29 20:14:38
问题 I'm learning Angular Material and I'm getting this error when importing { MatButtonModule } from "@angular/material/button". From what I read in other answers, it looks like package compatibility issues but I couldn't fix it. Here's the full error ERROR in node_modules/@angular/cdk/a11y/focus-trap/focus-trap.d.ts(29,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@angular/cdk/a11y/focus-trap/focus-trap.d.ts(30,9): error TS1086: An accessor cannot be