2016-12-02 13:00:55 -05:00
|
|
|
import { EventEmitter, Component, Input, Output } from "@angular/core";
|
2016-12-01 15:21:07 -05:00
|
|
|
import { Platform, NavParams, ViewController } from 'ionic-angular';
|
2016-12-02 13:00:55 -05:00
|
|
|
import { Reference } from '../../Reference.ts';
|
2016-12-01 13:40:04 -05:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: "strongs-modal",
|
|
|
|
templateUrl: "strongs-modal.html"
|
|
|
|
})
|
|
|
|
export class StrongsModal {
|
|
|
|
item: StrongsResult;
|
|
|
|
|
2016-12-02 13:00:55 -05:00
|
|
|
@Output()
|
|
|
|
onPassageClicked = new EventEmitter<string>();
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
public platform: Platform,
|
|
|
|
public params: NavParams,
|
|
|
|
public viewCtrl: ViewController
|
2016-12-01 13:40:04 -05:00
|
|
|
) {
|
|
|
|
this.item = this.params.get('strongsid') as StrongsResult;
|
2016-12-02 13:00:55 -05:00
|
|
|
this.onPassageClicked.subscribe(item =>
|
|
|
|
this.params.get('onPassageClicked').getItems(item)
|
|
|
|
)
|
2016-12-01 13:40:04 -05:00
|
|
|
}
|
|
|
|
|
2016-12-02 13:00:55 -05:00
|
|
|
dismiss() {
|
|
|
|
this.viewCtrl.dismiss();
|
|
|
|
}
|
|
|
|
makePassage(p: string) {
|
|
|
|
return Reference.bookName(p.split(";")[0]) + ' ' + p.split(";")[1] + ":" + p.split(";")[2];
|
|
|
|
}
|
|
|
|
openPassage(p: string) {
|
|
|
|
let ref = this.makePassage(p);
|
|
|
|
//this.dismiss();
|
|
|
|
this.onPassageClicked.emit(ref);
|
2016-12-01 13:40:04 -05:00
|
|
|
}
|
|
|
|
}
|