UNPKG

ethio-calendar-converter-angular

Version:
33 lines (30 loc) 910 B
import { Component } from '@angular/core'; import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; import { EthiopianCalendarModule, EthiopianDate, GregorianDate } from 'src/public-api'; @Component({ selector: 'app-root', standalone: true, imports: [ CommonModule, FormsModule, EthiopianCalendarModule ], template: ` <div class="container mx-auto p-4"> <h1 class="text-2xl font-bold mb-4">Ethiopian Calendar Converter</h1> <ethiopian-calendar (ethiopianDateChange)="onEthiopianDateChange($event)" (gregorianDateChange)="onGregorianDateChange($event)"> </ethiopian-calendar> </div> ` }) export class AppComponent { onEthiopianDateChange(date: EthiopianDate) { console.log('Ethiopian Date:', date); } onGregorianDateChange(date: GregorianDate) { console.log('Gregorian Date:', date); } }