2017-12-19 14:57:07 +01:00
|
|
|
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({
|
2017-12-20 09:17:13 +01:00
|
|
|
selector: 'app-dataset-wizard-component',
|
|
|
|
templateUrl: 'dataset-wizard.component.html',
|
|
|
|
styleUrls: ['./dataset-wizard.component.scss'],
|
2017-12-19 14:57:07 +01:00
|
|
|
providers: [DataManagementPlanService],
|
|
|
|
encapsulation: ViewEncapsulation.None
|
|
|
|
})
|
2017-12-20 09:17:13 +01:00
|
|
|
export class DatasetWizardComponent implements AfterViewInit {
|
2017-12-19 14:57:07 +01:00
|
|
|
|
|
|
|
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']);
|
|
|
|
}
|
|
|
|
}
|