These are chat archives for angular/material

17th
Apr 2018
Raj Bisht
@Whhymee
Apr 17 2018 05:09
yeah its version fa 4.7 not 5
yurigoular
@yurigoular
Apr 17 2018 14:09
good morning, i'm having a little problem with md-input-container in angular material, in mobile version, when i set the focus in the input, the mobile open the virtual keyboard, but the javascript don't set the focus on the input, so the input stay behind the element, can somente help me?
stherrienaspnet
@stherrienaspnet
Apr 17 2018 18:57
How to set form as pristine?
yurigoular
@yurigoular
Apr 17 2018 18:58
$scope[formName].$setPristine()
stherrienaspnet
@stherrienaspnet
Apr 17 2018 18:59
I'm using angular 5
yurigoular
@yurigoular
Apr 17 2018 19:00
this.form.markAsPristine()
stherrienaspnet
@stherrienaspnet
Apr 17 2018 19:01
thanks :))
do i need also markAsUntouched?
yurigoular
@yurigoular
Apr 17 2018 19:03
if you use untouched for validate...
stherrienaspnet
@stherrienaspnet
Apr 17 2018 19:04
nope, thank @yurigoular
yuri there is still something wrong
let met show you 2 captures...
image.png
this when i load the page
and here is when i have saved the data and reset the form using
    this.customerForm.reset();
    this.customerForm.markAsPristine();
stherrienaspnet
@stherrienaspnet
Apr 17 2018 19:09
image.png
do i have to loop each controls to mark them pristine?
yurigoular
@yurigoular
Apr 17 2018 19:11
set as valid
stherrienaspnet
@stherrienaspnet
Apr 17 2018 19:12
this.customerForm.setValid?
yurigoular
@yurigoular
Apr 17 2018 19:14
https://angular.io/api/forms/AbstractControl
Have the section of setValidators
Himanshu joshi
@himjoshu_twitter
Apr 17 2018 19:57
i want to pass value from a component to it's grandparent component on certain value change in that component when certain event occurs.
i'm using angular 5
i'm try to pass a boolean value to grandparent component on login or signup success in form so that profile button hidden proprty get false and it can use service where after auth value got store.
yurigoular
@yurigoular
Apr 17 2018 20:02
i guess tyou can pass the function to Child and execute in child
yurigoular
@yurigoular
Apr 17 2018 20:09
if you pass as two-way binding, from grandparent to the current component, isn't possible?
stherrienaspnet
@stherrienaspnet
Apr 17 2018 21:01
I do not understand how mat-error is working
here is my field name
              <mat-icon color="primary">business</mat-icon>
              <mat-form-field class="field-with-icon">
                <input matInput [formControl]="name" placeholder="{{'NAME' | translate}}" value="" required>
                <mat-error *ngIf="duplicateError == true">
                  {{'DUPLICATE_CUSTOMER_NAME' |translate}}
                </mat-error>
              </mat-form-field>
when i set this.dupplicateError = true nothing is displayed on the form, no error message, did i forgot something?