angular-custom-form/src/app/home.component.ts
2022-03-01 10:50:45 -06:00

39 lines
766 B
TypeScript

import { Component, OnInit } from '@angular/core';
import { checkin, checkout } from "src/assets/forms";
@Component({
selector: 'app-home',
template: `
<div class="menu">
<button (click)="switch('checkout')">Check Out</button>
<button (click)="switch('checkin')">Check In</button>
</div>
<app-form *ngIf="action=='checkin'" [template]="checkin"></app-form>
<app-form *ngIf="action=='checkout'" [template]="checkout"></app-form>
<footer>Accenture | 2022</footer>
`
})
export class HomeComponent implements OnInit {
checkin: Form = checkin;
checkout: Form = checkout;
action: string = "checkout";
ngOnInit() { }
switch(action: string) {
alert("Are you sure?");
this.action = action;
}
}