mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 15:53:27 +00:00
add/edit components setup
This commit is contained in:
@@ -2,8 +2,10 @@ import * as template from './view.component.html';
|
||||
|
||||
import {
|
||||
Component,
|
||||
EventEmitter,
|
||||
Input,
|
||||
OnChanges,
|
||||
Output,
|
||||
} from '@angular/core';
|
||||
|
||||
import { CipherService } from 'jslib/abstractions/cipher.service';
|
||||
@@ -16,6 +18,7 @@ import { CipherView } from 'jslib/models/view/cipherView';
|
||||
})
|
||||
export class ViewComponent implements OnChanges {
|
||||
@Input() cipherId: string;
|
||||
@Output() onEditCipher = new EventEmitter<string>();
|
||||
cipher: CipherView;
|
||||
|
||||
constructor(private cipherService: CipherService) {
|
||||
@@ -25,4 +28,8 @@ export class ViewComponent implements OnChanges {
|
||||
const cipher = await this.cipherService.get(this.cipherId);
|
||||
this.cipher = await cipher.decrypt();
|
||||
}
|
||||
|
||||
edit() {
|
||||
this.onEditCipher.emit(this.cipher.id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user