54 lines
1.2 KiB
TypeScript
Raw Normal View History

import { Component, EventEmitter, Output, Input, OnInit } from "@angular/core";
import { OpenData, CardItem } from "../../pages/search/search";
import { BiblePassageResult, BibleService } from '../../services/bible-service';
import { Reference } from '../../libs/Reference';
@Component({
selector: "passage",
templateUrl: "passage.html",
providers: [BibleService]
})
export class Passage implements OnInit
{
@Output()
onItemClicked = new EventEmitter<OpenData>();
@Output()
onClose = new EventEmitter<CardItem>();
@Input()
cardItem: CardItem;
@Input()
versesOnNewLine: boolean;
data: BiblePassageResult;
constructor(private bibleService: BibleService)
{
}
ngOnInit(): void
{
let myref = new Reference(this.cardItem.qry);
this.bibleService.getResultAsPromise(myref.Section).then(data => this.data = data);
}
close()
{
this.onClose.emit(this.cardItem);
}
openStrongs(strongs: string)
{
this.onItemClicked.emit({ card: this.cardItem, qry: this.cardItem.dict + strongs });
}
openMenu(strongs: string)
{
2017-01-04 17:17:56 -05:00
}
isPunct(c: string)
{
return new RegExp('^[\.\,\;\:\?\!]$').test(c)
}
}