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(); @Output() onClose = new EventEmitter(); @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, from_search_bar: false }); } openMenu(strongs: string) { } isPunct(c: string) { return new RegExp('^[\.\,\;\:\?\!]$').test(c) } }