angular-material

Styling mat-radio-button in Angular Material

痴心易碎 提交于 2020-04-13 06:06:08
问题 I have just started using the Angular Material theme within my Angular app. I make use of some radio buttons but want to style them so that they are smaller than usual. I can style the text labels but I am struggling to style the actual buttons themselves (the circles). So for now, I have <mat-radio-group class="smallRadio"> <mat-radio-button value="1">Option 1</mat-radio-button> <mat-radio-button value="2">Option 2</mat-radio-button> </mat-radio-group> How should I go about that? 回答1: Try

How to change data in column based on condition on mat table

雨燕双飞 提交于 2020-04-07 08:14:05
问题 I am displaying data on mat table from rest api, In which there is a column "changeType" which displaying data in numeric form. Here it displaying "4" for "Add", and "1" for "Update". I want to display the proper word instead of number to make user more understandable. How can i achieve it? <ng-container matColumnDef="changeType"> <th mat-header-cell *matHeaderCellDef> Change Type </th> <td mat-cell *matCellDef="let element"> {{element.changeType}} </td> </ng-container> 回答1: You can do a

How to change data in column based on condition on mat table

萝らか妹 提交于 2020-04-07 08:12:13
问题 I am displaying data on mat table from rest api, In which there is a column "changeType" which displaying data in numeric form. Here it displaying "4" for "Add", and "1" for "Update". I want to display the proper word instead of number to make user more understandable. How can i achieve it? <ng-container matColumnDef="changeType"> <th mat-header-cell *matHeaderCellDef> Change Type </th> <td mat-cell *matCellDef="let element"> {{element.changeType}} </td> </ng-container> 回答1: You can do a

Trigger event on re-selecting same value on mat-select

*爱你&永不变心* 提交于 2020-04-07 03:56:27
问题 I'm working on a mat-table which implements pagination, filtering, selection, etc. I have this mat-select on one of the header columns which I use to set a global value for all the other mat-select on the same column... Like this Everything works good so far, but lets say I choose a global value, and then I increase the pageSize of the table, the rows that already had the selection will stay that way, but the new additional rows will have the default value; now if I go to the global mat

How to make Angular Material Card Title one liner?

流过昼夜 提交于 2020-04-07 03:45:48
问题 I am unable to force mat-card-title to stay in one line and cut off the extra text. I have tried the css class below (text-oneline). <mat-card> <mat-card-header> <mat-card-title class="text-oneline">Heeeeeellllllloooo</mat-card-title> <mat-card-subtitle>World!</mat-card-subtitle> </mat-card-header> <img mat-card-image [src]="icon_url" alt="App Icon"> <mat-card-content> <p>Some Text</p> </mat-card-content> <mat-card-actions> <button mat-button>Hello</button> </mat-card-actions> </mat-card>

Create angular material theme with CSS variables

旧街凉风 提交于 2020-04-06 02:43:26
问题 I am working on a project that requires to be themeable at runtime. So I created a theme system that combines SCSS variable with CSS Variables. This is how it looks. :root { --primary-color: 196; } // Primary $primary-100: hsl(var(--primary-color), 90%, 98%); $primary-400: hsl(var(--primary-color), 90%, 65%); $primary-main: hsl(var(--primary-color), 90%, 50%); $primary-700: hsl(var(--primary-color), 90%, 30%); $primary-900: hsl(var(--primary-color), 90%, 10%); While this works amazingly with

To highlight the selected row in mat-selection list and show its corresponding data by default

白昼怎懂夜的黑 提交于 2020-03-30 05:14:00
问题 When we hover over the first column of the table a tooltip appears and then on clikcing on the button presnt in the tooltip mat dialog opens up. The data loads but for the first time when the dialog opens up the row is not selected by default. Note: (after the dialog has opened then on selecting any row its corresponding data loads and the row gets higlighted ,so this part works, but default highlighting of the left section row does not work when the popup opens for the first time) The dialog

To highlight the selected row in mat-selection list and show its corresponding data by default

别说谁变了你拦得住时间么 提交于 2020-03-30 05:10:08
问题 When we hover over the first column of the table a tooltip appears and then on clikcing on the button presnt in the tooltip mat dialog opens up. The data loads but for the first time when the dialog opens up the row is not selected by default. Note: (after the dialog has opened then on selecting any row its corresponding data loads and the row gets higlighted ,so this part works, but default highlighting of the left section row does not work when the popup opens for the first time) The dialog

How to make Angular Material Dialog re sizable in Angular 7?

余生颓废 提交于 2020-03-26 03:59:10
问题 I am using angular material dialog and AngularJS 7 . I am able to drag the dialog but I want to make that dialog re sizable so that used can resize it to what ever the size he wants. const dialogRef = this.dialog.open(DialogCompComponent,{data : "hello"}); dialogRef.afterClosed().subscribe(result => { console.log(`Dialog closed: ${result}); }); Where DialogCompComponent is the dialog content component.How to make this angular material dialog re-sizable? 回答1: I managed to solve your problem,

Angular drag and drop not working when dropping elements in n-ary tree represented using recursive template

a 夏天 提交于 2020-03-25 20:06:02
问题 I'm new to angular material drag and drop. My app is using an n-ary tree, and since I don't know its form apriori, I've been forced to use a recursive template in order to represent it. The last couple of days I've been trying to use Angular material drag and drop to reorder siblings. If I remove the root node everything works just fine, but I cannot remove the root node since I need it to traverse the tree for other operations. Bellow is a simplified form of the tree. In reality, the tree