61 lines
1.8 KiB
TypeScript
61 lines
1.8 KiB
TypeScript
|
import { Component, ViewChild, OnInit, AfterViewInit, ViewEncapsulation } from "@angular/core";
|
||
|
import { DataManagementPlanService } from "../services/data-management-plan/data-management-plan.service";
|
||
|
import { FormGroup, Validators, FormBuilder } from "@angular/forms";
|
||
|
|
||
|
|
||
|
|
||
|
@Component({
|
||
|
selector: 'app-dmp-wizard-component',
|
||
|
templateUrl: 'dmp-wizard.component.html',
|
||
|
styleUrls: ['./dmp-wizard.component.scss'],
|
||
|
providers: [DataManagementPlanService],
|
||
|
encapsulation: ViewEncapsulation.None
|
||
|
})
|
||
|
export class DataManagementPlanWizardComponent implements AfterViewInit {
|
||
|
|
||
|
constructor(
|
||
|
private dataManagementPlanService: DataManagementPlanService,
|
||
|
private formBuilder: FormBuilder
|
||
|
) {
|
||
|
|
||
|
}
|
||
|
|
||
|
isLinear = false;
|
||
|
firstFormGroup: FormGroup;
|
||
|
secondFormGroup: FormGroup;
|
||
|
|
||
|
ngOnInit() {
|
||
|
this.firstFormGroup = this.formBuilder.group({
|
||
|
firstCtrl: ['', Validators.required]
|
||
|
});
|
||
|
this.secondFormGroup = this.formBuilder.group({
|
||
|
secondCtrl: ['', Validators.required]
|
||
|
});
|
||
|
}
|
||
|
|
||
|
ngAfterViewInit() {
|
||
|
// this.route.params.subscribe((params: Params) => {
|
||
|
// const itemId = params['id'];
|
||
|
|
||
|
// if (itemId != null) {
|
||
|
// this.isNew = false;
|
||
|
// this.dataManagementPlanService.getSingle(itemId).map(data => data as DataManagementPlanModel)
|
||
|
// .subscribe(data => {
|
||
|
// this.dataManagementPlan = new JsonSerializer<DataManagementPlanModel>().fromJSONObject(data, DataManagementPlanModel);
|
||
|
// this.formGroup = this.dataManagementPlan.buildForm();
|
||
|
// });
|
||
|
// } else {
|
||
|
// this.dataManagementPlan = new DataManagementPlanModel();
|
||
|
// setTimeout(() => {
|
||
|
// this.formGroup = this.dataManagementPlan.buildForm();
|
||
|
// });
|
||
|
// }
|
||
|
// });
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
public cancel(): void {
|
||
|
//this.router.navigate(['/dataManagementPlans']);
|
||
|
}
|
||
|
}
|