UNPKG

ohayolibs

Version:

Ohayo is a set of essential modules for ohayojp.

23 lines (19 loc) 671 B
import { Component, Inject, Input } from '@angular/core'; import { I18NService, MetaService } from '@core'; import { OHAYO_I18N_TOKEN } from '@ohayo/theme'; @Component({ selector: 'edit-button', template: ` <a href="{{ _full }}" target="_blank" class="edit-button" nz-tooltip nzTooltipTitle="{{ 'app.content.edit-page' | translate }}"> <i nz-icon nzType="edit"></i> </a> `, }) export class EditButtonComponent { _full: string; @Input() set item(data: any) { this._full = `${this.meta.github}/edit/master/${this.i18n.get(data.urls)}`; } constructor(private meta: MetaService, @Inject(OHAYO_I18N_TOKEN) private i18n: I18NService) { } }