mirror of
https://github.com/bitwarden/browser
synced 2025-12-25 12:43:36 +00:00
Enables one of the recommended rules of @angular-eslint. Since this rule was fairly trivial to fix and has no QA effects it seemed reasonable to migrate all code.
37 lines
1023 B
TypeScript
37 lines
1023 B
TypeScript
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from "@angular/core";
|
|
import { FormBuilder, Validators } from "@angular/forms";
|
|
import { Subject, takeUntil } from "rxjs";
|
|
|
|
import { SharedModule } from "../../shared";
|
|
|
|
@Component({
|
|
selector: "app-send-access-password",
|
|
templateUrl: "send-access-password.component.html",
|
|
imports: [SharedModule],
|
|
standalone: true,
|
|
})
|
|
export class SendAccessPasswordComponent implements OnInit, OnDestroy {
|
|
private destroy$ = new Subject<void>();
|
|
protected formGroup = this.formBuilder.group({
|
|
password: ["", [Validators.required]],
|
|
});
|
|
|
|
@Input() loading: boolean;
|
|
@Output() setPasswordEvent = new EventEmitter<string>();
|
|
|
|
constructor(private formBuilder: FormBuilder) {}
|
|
|
|
async ngOnInit() {
|
|
this.formGroup.controls.password.valueChanges
|
|
.pipe(takeUntil(this.destroy$))
|
|
.subscribe((val) => {
|
|
this.setPasswordEvent.emit(val);
|
|
});
|
|
}
|
|
|
|
ngOnDestroy() {
|
|
this.destroy$.next();
|
|
this.destroy$.complete();
|
|
}
|
|
}
|