File
Metadata
selector |
app-detail |
styleUrls |
detail.component.scss |
templateUrl |
detail.component.html |
formData
|
formData: { name: string; weight: string; height: string; gender: string; }
|
import { Component, NgModule } from '@angular/core';
import { DataServiceService } from './data-service.service';
@Component({
selector: 'app-detail',
templateUrl: './detail.component.html',
styleUrls: ['./detail.component.scss']
}
)
export class DetailComponent {
formData = {
name: '',
weight: '',
height: '',
gender: ''
};
constructor(private dataService: DataServiceService) { }
ngOnInit() {
const formData = localStorage.getItem('formData');
if (formData) {
this.formData = JSON.parse(formData);
}
}
}