lockscreen.component.ts 652 B

123456789101112131415161718192021222324
  1. import { Component, OnInit } from '@angular/core';
  2. import { Router } from '@angular/router';
  3. import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
  4. @Component({
  5. selector: 'app-lockscreen',
  6. templateUrl: './lockscreen.component.html',
  7. styleUrls: ['./lockscreen.component.scss']
  8. })
  9. export class LockscreenComponent implements OnInit {
  10. public form: FormGroup;
  11. constructor(private fb: FormBuilder, private router: Router) {}
  12. ngOnInit() {
  13. this.form = this.fb.group ( {
  14. uname: [ null, Validators.compose( [ Validators.required ] ) ]
  15. });
  16. }
  17. onSubmit() {
  18. this.router.navigate ( ['/user'] );
  19. }
  20. }