Broker System for Supercredit
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

31 line
901B

  1. import { Component, OnInit } from '@angular/core';
  2. import { FormControl, FormGroup, Validators } from '@angular/forms';
  3. import { Router } from '@angular/router';
  4. import { MenuService } from '../service/menu.service';
  5. @Component({
  6. selector: 'app-auth',
  7. templateUrl: './auth.component.html',
  8. styleUrls: ['./auth.component.scss']
  9. })
  10. export class AuthComponent implements OnInit {
  11. public userForm: FormGroup = new FormGroup({
  12. password: new FormControl('abcdefg', [Validators.minLength(3), Validators.maxLength(20)]),
  13. email: new FormControl('email@email.com', Validators.email)
  14. });
  15. constructor(private menuService: MenuService, private rounter: Router) { }
  16. ngOnInit(): void {
  17. this.menuService.loginSuccess.emit(null);
  18. }
  19. submitForm() {
  20. console.log(this.userForm);
  21. this.menuService.loginSuccess.emit(this.userForm)
  22. this.rounter.navigate(["/dashboard"]);
  23. }
  24. }