import {Component} from '@angular/core';
import {Router, RouterLink, RouterOutlet} from "@angular/router";
import {UserService} from "../corelib/service/user.service";
import {NgIf} from '@angular/common';
import {FormsModule} from '@angular/forms';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [
    RouterLink,
    FormsModule,
    NgIf,
    RouterOutlet
  ],
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {

  term: string = '';

  constructor(private router: Router,
              public userService: UserService
  ) {
  }

  onSubmit(): void {
    this.router.navigate(['/u/' + this.term])
      .then();
  }

}
