mirror of
https://github.com/bitwarden/browser
synced 2026-02-05 11:13:44 +00:00
use observable as an Output
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
[submitBtn]="submitBtn"
|
||||
(formReady)="onFormReady()"
|
||||
(cipherSaved)="onCipherSaved($event)"
|
||||
(onFormStatusChange)="formStatusChanged($event)"
|
||||
(formStatusChange$)="formStatusChanged($event)"
|
||||
>
|
||||
<bit-item slot="attachment-button">
|
||||
<button
|
||||
|
||||
@@ -112,13 +112,11 @@ export class CipherFormComponent implements AfterViewInit, OnInit, OnChanges, Ci
|
||||
|
||||
@Output() formReady = this.formReadySubject.asObservable();
|
||||
|
||||
@Output() onFormStatusChange = new EventEmitter<"enabled" | "disabled">();
|
||||
|
||||
/**
|
||||
* Emitted when the form is enabled
|
||||
*/
|
||||
private formStatusChangeSubject = new Subject<"enabled" | "disabled">();
|
||||
formStatusChange$ = this.formStatusChangeSubject.asObservable();
|
||||
@Output() formStatusChange$ = this.formStatusChangeSubject.asObservable();
|
||||
|
||||
/**
|
||||
* The original cipher being edited or cloned. Null for add mode.
|
||||
@@ -161,13 +159,11 @@ export class CipherFormComponent implements AfterViewInit, OnInit, OnChanges, Ci
|
||||
disableFormFields(): void {
|
||||
this.cipherForm.disable({ emitEvent: false });
|
||||
this.formStatusChangeSubject.next("disabled");
|
||||
this.onFormStatusChange.emit("disabled");
|
||||
}
|
||||
|
||||
enableFormFields(): void {
|
||||
this.cipherForm.enable({ emitEvent: false });
|
||||
this.formStatusChangeSubject.next("enabled");
|
||||
this.onFormStatusChange.emit("enabled");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user