mirror of
https://github.com/eugeny/tabby
synced 2025-12-14 11:46:06 +00:00
28 lines
607 B
TypeScript
28 lines
607 B
TypeScript
import { Component, Input, ViewChild, ElementRef } from '@angular/core'
|
|
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
|
|
|
|
@Component({
|
|
template: require('./promptModal.component.pug'),
|
|
})
|
|
export class PromptModalComponent {
|
|
@Input() value: string
|
|
@Input() password: boolean
|
|
@ViewChild('input') input: ElementRef
|
|
|
|
constructor (
|
|
private modalInstance: NgbActiveModal,
|
|
) { }
|
|
|
|
ngOnInit () {
|
|
this.input.nativeElement.focus()
|
|
}
|
|
|
|
ok () {
|
|
this.modalInstance.close(this.value)
|
|
}
|
|
|
|
cancel () {
|
|
this.modalInstance.close('')
|
|
}
|
|
}
|