2016-12-28 15:57:16 -05:00
|
|
|
import { EventEmitter, Component, Output } from "@angular/core";
|
2016-12-01 15:21:07 -05:00
|
|
|
import { Platform, NavParams, ViewController } from 'ionic-angular';
|
2017-01-18 17:51:06 -05:00
|
|
|
import { Reference } from '../../libs/Reference';
|
|
|
|
import { StrongsResult } from "../../services/strongs-service";
|
2016-12-01 13:40:04 -05:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: "strongs-modal",
|
|
|
|
templateUrl: "strongs-modal.html"
|
|
|
|
})
|
2017-01-18 17:51:06 -05:00
|
|
|
export class StrongsModal
|
|
|
|
{
|
2016-12-01 13:40:04 -05:00
|
|
|
item: StrongsResult;
|
|
|
|
|
2016-12-02 13:00:55 -05:00
|
|
|
@Output()
|
2016-12-31 14:50:40 -05:00
|
|
|
onPassageClicked = new EventEmitter<string>();
|
2016-12-02 13:00:55 -05:00
|
|
|
|
|
|
|
constructor(
|
|
|
|
public platform: Platform,
|
|
|
|
public params: NavParams,
|
|
|
|
public viewCtrl: ViewController
|
2017-01-18 17:51:06 -05:00
|
|
|
)
|
|
|
|
{
|
2016-12-01 13:40:04 -05:00
|
|
|
this.item = this.params.get('strongsid') as StrongsResult;
|
2017-01-16 21:36:22 -05:00
|
|
|
this.onPassageClicked.subscribe(item =>
|
2016-12-02 13:00:55 -05:00
|
|
|
this.params.get('onPassageClicked').getItems(item)
|
2017-01-18 17:51:06 -05:00
|
|
|
)
|
2016-12-01 13:40:04 -05:00
|
|
|
}
|
|
|
|
|
2017-01-18 17:51:06 -05:00
|
|
|
dismiss()
|
|
|
|
{
|
2016-12-02 13:00:55 -05:00
|
|
|
this.viewCtrl.dismiss();
|
|
|
|
}
|
2017-01-18 17:51:06 -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];
|
2016-12-02 13:00:55 -05:00
|
|
|
}
|
2017-01-18 17:51:06 -05:00
|
|
|
openPassage(p: string)
|
|
|
|
{
|
2016-12-02 13:00:55 -05:00
|
|
|
let ref = this.makePassage(p);
|
|
|
|
this.onPassageClicked.emit(ref);
|
2016-12-01 13:40:04 -05:00
|
|
|
}
|
2017-01-18 17:51:06 -05:00
|
|
|
}
|