import { Component, EventEmitter, forwardRef, Input, Output } from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';

@Component({
  selector: 'app-password-hide-show',
  imports: [],
   providers: [{
    provide: NG_VALUE_ACCESSOR,
    useExisting: forwardRef(() => PasswordHideShowComponent),
    multi: true
  }],
  templateUrl: './password-hide-show.component.html',
  styleUrl: './password-hide-show.component.scss'
})
export class PasswordHideShowComponent {
  @Output() onEyeClick = new EventEmitter();
  @Input() showPassword : boolean = false;
  inputType : String = '';
  constructor() { }

  ngOnInit(): void {
    
  }

  togglePassword(){
    this.showPassword = !this.showPassword;
    this.onEyeClick.emit();
  }
  reset() {
    this.showPassword = true;
  }
}
