angular-material

Adjusting mat-table on xs screen size using flex box css in angular 2

送分小仙女□ 提交于 2020-01-15 15:25:09
问题 I have implemented a simple angular material table using flexbox css. In the desktop my table view is as shown below. In md screen size the view is In xs screen size its view is When i see the table in XS screen view ,the spacing between the table columns is not properly adjusted.. Is there a way out where i can add a horizontal scroll to space the table columns properly by specifying a min width to my table and adding a horizontal scroll when in XS and SM screen sizes. Below shown is my

In angular 7 , How do I populate a mat-table with a data from an object

╄→гoц情女王★ 提交于 2020-01-15 10:35:15
问题 Currently I have the following code to populate a table. In component.ts: import { HttpClient } from "@angular/common/http"; import { Component, OnInit } from "@angular/core"; import { FormBuilder, FormGroup, Validators } from "@angular/forms"; import { ActivatedRoute, Router } from "@angular/router"; import { MatTableDataSource } from "@angular/material/table"; @Component({ styleUrls: ["./styles.scss"], templateUrl: "./template.html" }) export class MyRouteData { employeeInfoTable: object;

In angular 7 , How do I populate a mat-table with a data from an object

邮差的信 提交于 2020-01-15 10:34:31
问题 Currently I have the following code to populate a table. In component.ts: import { HttpClient } from "@angular/common/http"; import { Component, OnInit } from "@angular/core"; import { FormBuilder, FormGroup, Validators } from "@angular/forms"; import { ActivatedRoute, Router } from "@angular/router"; import { MatTableDataSource } from "@angular/material/table"; @Component({ styleUrls: ["./styles.scss"], templateUrl: "./template.html" }) export class MyRouteData { employeeInfoTable: object;

Angular 6: how to access ALL option values in mat-autocomplete dropdown?

柔情痞子 提交于 2020-01-15 03:32:06
问题 Given the example in the Angular docs you can see here and also repeated below, how can I access the rest of the object data in options ? If for example, the object was more than just a simple list of names in key:value format, but something more complex such as data coming in from an API: dataObject = { name: 'someName', nameID: 'someId', foo: 'bar' } The example in the docs is too simple and isn't telling me how to get the name to display in the input field, and to also get the

Completed property in Angular Material Stepper doesn't seem to work as expected

丶灬走出姿态 提交于 2020-01-15 03:18:06
问题 Here is a stackblitz of this behavior. What I expect to see is that when the Complete button is clicked, the first step is complete, so the icon would change to "10". However, there is no change, and even when moving to the second step, the icon is "create". Am I misunderstanding how the completed property is supposed to be working, or is there a bug in the Material code? 回答1: Couple of things wrong here: the icon is "create": The stepper has a dependency on material icons. Adding material

Angular 6 Get sorted data from Material Table

微笑、不失礼 提交于 2020-01-14 19:59:27
问题 Is there any way to get the sorted data from a material table after sorts on the table have been applied? I can see "filteredData" in the table datasource but there's no "sortedData". The reason why I want the sorted data is so that I can export it in a csv file while maintaining all of the sorts applied. I've been using the built in MatSort to sort individual columns in the table. 回答1: There is a sort data method, that you can use with either datasource.data or datasource.filteredData

How to properly change the color of a mat-icon with angular?

左心房为你撑大大i 提交于 2020-01-14 17:57:13
问题 I have looked at the documentation and I have tried to change the color of a mat-icon like so: <mat-icon class="white" color="primary" svgIcon="back"></mat-icon><span class="backText">back</span> The above is how the element looks in the html. I have tried to change the color of the icon by adding a class with a color of white. Which does not work. I have tried adding the directive color="primary" which does not work either while all my buttons that look like this <button mat-button color=

How to properly change the color of a mat-icon with angular?

邮差的信 提交于 2020-01-14 17:51:12
问题 I have looked at the documentation and I have tried to change the color of a mat-icon like so: <mat-icon class="white" color="primary" svgIcon="back"></mat-icon><span class="backText">back</span> The above is how the element looks in the html. I have tried to change the color of the icon by adding a class with a color of white. Which does not work. I have tried adding the directive color="primary" which does not work either while all my buttons that look like this <button mat-button color=

Angular material date picker: Date Parsing UTC problem 1 day before

六眼飞鱼酱① 提交于 2020-01-14 14:36:18
问题 I know there are several threads about this and i read them all but couldn't fix this for days. I might found a solution but it seems to be do dirty for me. So as other users I have the same problem with the datePicker. For me it's the Angular Material Datepicker mat-datepicker When I log the value I get the correct result: Wed Dec 24 1999 00:00:00 GMT+0100 (Mitteleuropäische Normalzeit) but in the request it is 1999-12-23T23:00:00.000Z What I tried yet: I've added { provide: MAT_MOMENT_DATE

How to override template for angular material 2 datepicker

让人想犯罪 __ 提交于 2020-01-14 12:58:14
问题 I need to modify the templates for the angular 2 material date-picker. Its templates are declared in several internal components that are defined in @angular/material/esm5/datepicker.es5.js. I could modify the template directly in the node package, but then it would get overwritten when updating. The only two ways I can see this being possible is if I modify the template dynamically (is this really possible?), or if I copy over the entire angular material node package locally and then modify