<div class="row">
<div class="input-field col m2">
<input type="date" [(ngModel)]="birthdate" id="txtdate">
</div>
<div class="input-field col m4">
<input type="number" [(ngModel)]="age" id="age">
</div>
<button (click)="CalculateAge()">Calculate Age</button>
</div>
And in your component
import { Component, OnInit } from '@angular/core';
@Component( {
selector: 'stud',
templateUrl: './student.component.html'
})
export class StudentComponent implements OnInit
{
public birthdate:
β¦
Top comments (0)