angular-material

Reset form on submit

你说的曾经没有我的故事 提交于 2019-12-24 01:10:31
问题 I am submitting a form and then making all the field empty but it's not working. Form is getting submitted successfully but the fields are not getting reset. I am using angular-material for styling. Updated controller. Html <form name="myform"> <md-input-container> <label for="name">Contact Name</label> <input type="text" md-maxlength="20" required="" md-no-asterisk name="name" ng-model="info.name" md-autofoucs> <div ng-messages="myform.name.$error" role="alert"> <div ng-message="required"

Angularfire2.5 Real Time Database with angular material autocomplete

倖福魔咒の 提交于 2019-12-24 00:52:41
问题 I am trying to use the angular material autocomplete input field with angularfire2 v5. I have some difficulties adapting the shown example: https://material.angular.io/components/autocomplete/examples to a firebase list. It seems that the functions used in the example can't work with an observable input: The following code : // FROM COMPOSERS.SERVICE.TS constructor(private db: AngularFireDatabase) { this.membersRef = db.list('/members'); this.members = this.membersRef.valueChanges(); }

How to get current value of Angular Material slider?

可紊 提交于 2019-12-24 00:38:05
问题 My question is different to Get mdslider value in angular 2? in that I needed to pass the value of the slider to the component, not just use a local variable; but also in respect of Angular Material having changed so that the slider now requires an $event object to be passed to the component function. I have an Angular Material slider component in Angular 4: HTML <mat-slider min="430" max="500" step="10" value="450" (input)="pitch($event)"></mat-slider> TS import { Component, OnInit } from '

add name to input generated with md-datepicker from Angular Material

孤者浪人 提交于 2019-12-24 00:34:14
问题 I'm using md-datepicker from Angular Material https://material.angularjs.org/latest/demo/datepicker to generate an input with a datepicker. It works properly, but I've noticed the input doesn't have a name: This is my HTML code: <div ng-app="angApp" ng-controller="ScheduleController" style='padding: 40px;' ng-cloak> <md-content> <md-datepicker ng-model="myDate" md-placeholder="Enter date"></md-datepicker> </md-content> </div> This is my Javascript: var app = angular.module('angApp', [

Localising the date value in Angular Material datepicker

无人久伴 提交于 2019-12-24 00:14:19
问题 I'm working with Angular Material date picker. My problem is that when I send a date to the Web Api controller, I get a date less than the date I have selected in my form. I think this is due to the fact that the date value is not being localized. What I want to know is that how to localize the date in angular js HTML: <div ng-controller="AppCtrl" style='padding: 40px;' ng-cloak> <md-content> <h4>Standard date-picker</h4> <md-datepicker ng-model="myDate" md-placeholder="Enter date"></md

Angular Material table drag and drop columns with sorting not wroking

此生再无相见时 提交于 2019-12-23 22:56:03
问题 The angular material table with sorting doesn't work properly with drag-and-drop. Here's what I've got so far, it kinda works where the sorting works with a specific column after being dragged and dropped. But still has weird functionality. Stackblitz I want to be able to use the normal sorting functionality of Material Table while being able to drag and drop columns. 回答1: matSort needs to be on the mat-table element <mat-table [dataSource]="dataSource" class="mat-elevation-z8"

Angular material tab animation doesn't work

て烟熏妆下的殇ゞ 提交于 2019-12-23 22:18:28
问题 I have angular material navigation tabs like in sample below. Tabs itself works fine and navigation works too. My issue is animation doesn't work. When I click a tab, instead of animation I get tab of triple size for couple of seconds. I have BrowserAnimationsModule and MatTabsModule in my imports in my app.module.ts. What might be the issue? How to fix animation? <nav mat-tab-nav-bar> <a mat-tab-link [routerLink]="'/'" routerLinkActive #rla="routerLinkActive" [active]="rla.isActive"> Home <

Angular material select doesn't detect changes to options generated by nested component

一世执手 提交于 2019-12-23 20:33:13
问题 I'm trying to extract the logic that filters and displays my mat-option s for my mat-select s into their own component. For some reason however, the options get displayed but clicking on them doesn't fire an event. The web app I'm writing have a lot of mat-select s which each potentially have a lot of mat-option s. For obvious reasons, I need a way to filter the options so I'm using this node package. This pattern of "select with search field" appears a lot throughout the application, which

Angular Material Select (mat-select) not showing when Angular Google Maps in full screen mode

醉酒当歌 提交于 2019-12-23 18:52:19
问题 I am using Angular Material and Angular Google Maps. I have a Angular Material form in the Snazzy-Info-Window which works fine in normal mode. It displays the mat-select nicely but when I click the fullscreen button the mat-options in the mat-select don't show up. As soon as I come out of the full screen mode, I see the options panel. Is this a bug or am I missing something. The dropdown options show up if I use the native select but not mat-select. NORMAL MODE FULLSCREEN MODE When in

Phone number pattern validation in angular material designing

半城伤御伤魂 提交于 2019-12-23 17:27:46
问题 I want to validate phone number using angular material designing code but below code is not working even when i enter valid phone number ca n some on help me please <mat-form-field class="example-full-width"> <input matInput placeholder="Phone number" formControlName="PhoneNumber" [errorStateMatcher]="matcher" [(ngModel)]="PhoneNumber" required pattern="[6-9]\\d{9}" maxlength="10"> <mat-hint>Errors appear instantly!</mat-hint> <mat-error *ngIf="emailForm.get('PhoneNumber').hasError('required'