41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
import { BibleVerseService } from './../../services/bible-verse.service';
|
|
import { Component, OnInit, Inject, Input } from '@angular/core';
|
|
import { MatDialogConfig, MatDialog } from '@angular/material';
|
|
import { SharePopupComponent } from '../popups/share-popup/share-popup.component';
|
|
import { DOCUMENT } from '@angular/platform-browser';
|
|
import { Router, ActivatedRouteSnapshot, ActivatedRoute } from '@angular/router';
|
|
|
|
@Component({
|
|
selector: 'image-component',
|
|
templateUrl: './image.component.html',
|
|
styleUrls: ['./image.component.css']
|
|
})
|
|
export class ImageComponent implements OnInit {
|
|
|
|
public imageUrl: string;
|
|
public shareName: string
|
|
|
|
constructor(private dialog: MatDialog, @Inject(DOCUMENT) private document, private route: ActivatedRoute) {
|
|
this.imageUrl = this.route.snapshot.data.imageUrl;
|
|
this.shareName = this.route.snapshot.data.shareName;
|
|
}
|
|
|
|
ngOnInit() {
|
|
// this.bibleVerseService.randomVerse().subscribe(
|
|
// verse => {
|
|
|
|
// },
|
|
// error => console.log(error) );
|
|
}
|
|
|
|
public share() {
|
|
let opts = new MatDialogConfig;
|
|
opts.data = {
|
|
prefix: 'o',
|
|
otherName: this.shareName
|
|
};
|
|
let dialog = this.dialog.open(SharePopupComponent, opts);
|
|
}
|
|
|
|
}
|