<commit_before>import { App } from 'ionic-angular';
import { ElementRef, HostListener, Directive } from '@angular/core';

import { ImageViewer } from './image-viewer';

@Directive({
	selector: '[imageViewer]'
})
export class ImageViewerDirective {

	constructor(
		private _app: App,
		private _el: ElementRef
	) { }

	@HostListener('click', ['$event.target'])
	onClick($event): void {
		let position = this._el.nativeElement.getBoundingClientRect();

		let imageViewer = ImageViewer.create({image: this._el.nativeElement.src, position: position});
		this._app.present(imageViewer, {});
	}
}<commit_msg>Add optional image src.<commit_after>import { App } from 'ionic-angular';
import { ElementRef, HostListener, Directive, Input } from '@angular/core';

import { ImageViewer } from './image-viewer';

@Directive({
	selector: '[imageViewer]'
})
export class ImageViewerDirective {

	@Input('imageViewer') src: string;

	constructor(
		private _app: App,
		private _el: ElementRef
	) { }

	@HostListener('click', ['$event.target'])
	onClick($event): void {
		let position = this._el.nativeElement.getBoundingClientRect();

		let imageViewer = ImageViewer.create({image: this.src || this._el.nativeElement.src, position: position});
		this._app.present(imageViewer, {});
	}
}
{'fraction_non_alphanumeric': 0.15251572327044025, 'fraction_numerical': 0.0, 'mean_word_length': 5.365, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3371246', 'n_tokens_mistral': 424, 'n_tokens_neox': 401, 'n_words': 90}