49 lines
1.2 KiB
TypeScript
Raw Normal View History

import { EventEmitter, Component, Output } from "@angular/core";
import { Platform, NavParams, ViewController } from 'ionic-angular';
import { Reference } from '../../libs/Reference';
import { StrongsResult } from "../../services/strongs-service";
@Component({
selector: "strongs-modal",
templateUrl: "strongs-modal.html"
})
export class StrongsModal
{
item: StrongsResult;
@Output()
onItemClicked = new EventEmitter<string>();
constructor(
public platform: Platform,
public params: NavParams,
public viewCtrl: ViewController
)
{
this.item = this.params.get('strongsid') as StrongsResult;
this.onItemClicked.subscribe(item =>
this.params.get('onItemClicked').getItems(item)
)
}
dismiss()
{
this.viewCtrl.dismiss();
}
openItem(p: string)
{
this.onItemClicked.emit(p);
}
makePassage(p: string)
{
return Reference.bookName(parseInt(p.split(";")[0])) + ' ' + p.split(";")[1] + ":" + p.split(";")[2];
}
openPassage(p: string)
{
let ref = this.makePassage(p);
this.onItemClicked.emit(ref);
}
}