1
0
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:
Kyle Spearrin
2018-01-24 17:41:57 -05:00
parent 4f62792bda
commit 18a45886d1
11 changed files with 187 additions and 11 deletions

View File

@@ -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);
}
}