42 lines
1.1 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()
onPassageClicked = new EventEmitter<string>();
constructor(
public platform: Platform,
public params: NavParams,
public viewCtrl: ViewController
)
{
this.item = this.params.get('strongsid') as StrongsResult;
2017-01-16 21:36:22 -05:00
this.onPassageClicked.subscribe(item =>
this.params.get('onPassageClicked').getItems(item)
)
}
dismiss()
{
this.viewCtrl.dismiss();
}
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.onPassageClicked.emit(ref);
}
}