angular-material

Material Angular 6 DatePicker is parsing my date 1 day before

可紊 提交于 2019-12-30 08:12:15
问题 There's something really weird happening to the current version of the Material Angular DatePicker, after I updated it from A5 to A6 it started to parse my date 1 day before, the example is here: https://stackblitz.com/edit/angular6-datepicker-parsing-wrong-date I'm using the original documentation example with a slight change on the language to my own language, and applying a custom date value to the ngModel so it can parse. But you can check the code here: import {Component} from '@angular

Material Angular 6 DatePicker is parsing my date 1 day before

血红的双手。 提交于 2019-12-30 08:12:14
问题 There's something really weird happening to the current version of the Material Angular DatePicker, after I updated it from A5 to A6 it started to parse my date 1 day before, the example is here: https://stackblitz.com/edit/angular6-datepicker-parsing-wrong-date I'm using the original documentation example with a slight change on the language to my own language, and applying a custom date value to the ngModel so it can parse. But you can check the code here: import {Component} from '@angular

Angular Material mat-table is not showing updated data from data source

為{幸葍}努か 提交于 2019-12-30 07:04:13
问题 My simple task is to add the text typed in an input box to the mat-table but it didn't work as expected. The datasource only refreshed one time and didn't show update data start from the second time. Here is my code app.component.html <div class="main" fxLayout="column" fxGap="10"> <div class="input-area"> <mat-form-field> <input matInput placeholder="Type something" [(ngModel)]="currentText"> </mat-form-field> <button mat-raised-button color="primary" style="margin-left:10px;" (click)="onAdd

Angular Material fixed toolbar AND sticky footer

北战南征 提交于 2019-12-30 00:35:11
问题 I have been beating my head against this issue for some time now and sort of came up with a solution. I would like a fixed toolbar (navbar) as well as a sticky (floating) footer. The footer should float at the bottom of the main section but be sticky to the bottom when there is no content. It seems that I can do one or the other but not both. With this method the toolbar is fixed but the footer isn't sticky. It butts up to the toolbar when the main section is empty. <body ng-controller=

How can I pass a service variable into an Angular Material dialog?

混江龙づ霸主 提交于 2019-12-29 18:45:52
问题 For mdDialog, how do I pass in variable? Specifically, how to inject an Angular service into the dialog component? 回答1: For passing variables you can grab the instance of the component opened in the dialog, from the MdDialogRef instance returned in the MdDialog.open() method call. dialogRef = this.dialog.open(PizzaDialog, config) dialogRef.componentInstance.<property_name> Modified Pizza from the github material2 docs @Component({ selector: 'pizza-component', template: ` <button type="button"

Angular Material mat-datepicker (change) event and format

跟風遠走 提交于 2019-12-29 08:28:28
问题 I am using angular material datepicker directive and I have few problems. 1. When I open date picker dialog and select any date, date shows up in input text box, but I want to call a function when ever any change occur in input text box. Right now if I manually enter any value in input text box, I am triggering function using (input) directive and it is working fine as shown in code. I want to trigger same function when date gets change using date picker dialog. 2. I also want to change the

Can I programmatically move the steps of a mat-horizontal-stepper in Angular / Angular Material

混江龙づ霸主 提交于 2019-12-29 02:49:36
问题 I have a question regards Angular Material (with Angular 4+). Say in my component template I add a <mat-horizontal-stepper> component, and within each step <mat-step> I have stepper buttons to navigate the component. Like so... <mat-horizontal-stepper> <mat-step> Step 1 <button mat-button matStepperPrevious type="button">Back</button> <button mat-button matStepperNext type="button">Next</button> </mat-step> <mat-step> Step 2 <button mat-button matStepperPrevious type="button">Back</button>

How to change URLs automatically in services, after changing URL it should affect to all components without saving/ building/running in angular6

天大地大妈咪最大 提交于 2019-12-29 02:00:07
问题 We are hosting a new application with angular 6 and we have many servers with diff URLs, i want to change them automatically(like .property file in java). after searching in google i got some answers like changing paths in environment.ts file, so it will affect to all components. but its not exactly my requirements, means if i change URL in environment.ts file, we should save the file and we need to compile it once again. So exactly this is the problem i am facing, i don't want to save /

custom filter in mat-table

社会主义新天地 提交于 2019-12-28 03:44:03
问题 I'm using mat-table. It has a filter which works fine with doc example: From https://material.angular.io/components/table/overview, the original code is: <div class="example-header"> <mat-form-field> <input matInput (keyup)="applyFilter($event.target.value)" placeholder="Filter"> </mat-form-field> </div> <mat-table #table [dataSource]="dataSource"> <!-- the rest of the code --> </mat-table> export class TableFilteringExample { displayedColumns = ['position', 'name', 'weight', 'symbol'];

Angular Material Table set default number of rows

拟墨画扇 提交于 2019-12-26 03:09:08
问题 I want to set a number of rows on the table on page load having no data yet. If I click a button for me to display the list of data it will then populate the rows for n number I set. I already tried adding a default length on the matrow. Let say ngOnInit() it will display 8 rows and when I click a button to display the data, it would fill up the 8 rows I set and there's still a pagination using mat-paginator . Is this possible? 回答1: Populate using empty data according to the number of initial