These are chat archives for angular/material

22nd
Dec 2017
Rumes Shyaman
@rumes
Dec 22 2017 03:24
@costea93 here is the component
import { Component, OnInit } from '@angular/core';
import {FormControl, Validators, FormGroup} from '@angular/forms';

@Component({
  selector: 'app-login',
  templateUrl: './login.component.html',
  styleUrls: ['./login.component.css']
})
export class LoginComponent implements OnInit {
  private loginForm:FormGroup;
  constructor() { }

  ngOnInit() {
    this.loginForm = new FormGroup({
      'username': new FormControl('',[
        Validators.required,
        Validators.email,
      ]),
      'password': new FormControl('',[
        Validators.required,
        Validators.minLength(6),
      ]),
    })
  }

}
Constantin
@costea93
Dec 22 2017 07:23
In template instead password.error.required write loginForm.controls.password.error.required
And the same thing for all errors
Rumes Shyaman
@rumes
Dec 22 2017 07:30
thanks man. I will try
xxxileemn
@xxxileemn
Dec 22 2017 15:48
hi guys
milanpatel123
@milanpatel123
Dec 22 2017 16:36
hello all
i have using ng-bootstrap model it is working but i have problem in my update function it is not close how to close it.