2016-12-27 21:10:00 -05:00
|
|
|
import {EventEmitter, Component, Input, Output} from "@angular/core";
|
2017-01-16 21:36:22 -05:00
|
|
|
import { Reference } from '../../Reference';
|
2016-12-27 21:10:00 -05:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: "words",
|
|
|
|
templateUrl: "words.html"
|
|
|
|
})
|
|
|
|
export class Words {
|
|
|
|
@Output()
|
|
|
|
onClose = new EventEmitter<CardItem>();
|
|
|
|
|
|
|
|
@Output()
|
2016-12-28 16:57:40 -05:00
|
|
|
onPassageClicked = new EventEmitter<OpenData>();
|
2016-12-27 21:10:00 -05:00
|
|
|
|
|
|
|
@Input()
|
|
|
|
item: WordLookupResult;
|
|
|
|
|
|
|
|
@Input()
|
|
|
|
cardItem: CardItem;
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
}
|
|
|
|
|
|
|
|
close() {
|
|
|
|
this.onClose.emit(this.cardItem);
|
|
|
|
}
|
|
|
|
|
2017-01-16 21:36:22 -05:00
|
|
|
makePassage(p: string)
|
2016-12-27 21:10:00 -05:00
|
|
|
{
|
|
|
|
return Reference.bookName(parseInt(p.split(":")[0])) + ' ' + p.split(":")[1] + ":" + p.split(":")[2];
|
|
|
|
}
|
2017-01-16 21:36:22 -05:00
|
|
|
openPassage(p: string)
|
2016-12-27 21:10:00 -05:00
|
|
|
{
|
|
|
|
let ref = this.makePassage(p);
|
2016-12-28 16:57:40 -05:00
|
|
|
this.onPassageClicked.emit({ card: this.cardItem, qry: ref });
|
2016-12-27 21:10:00 -05:00
|
|
|
}
|
2017-01-16 21:36:22 -05:00
|
|
|
}
|