mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-01-20 11:38:59 +00:00
Update template-list-dialog.component.ts
This commit is contained in:
parent
e11281ddf6
commit
f40b2c64c2
@ -9,6 +9,7 @@ import { Template } from '../../../models/template';
|
||||
import { FormBuilder, FormGroup, FormControl, Validators } from '@angular/forms';
|
||||
import { ToasterService } from '../../../services/toaster.service';
|
||||
import { Project } from '../../../models/project';
|
||||
import { NonNegativeValidator } from '../../../validators/non-negative-validator';
|
||||
|
||||
@Component({
|
||||
selector: 'app-template-list-dialog',
|
||||
@ -34,13 +35,14 @@ export class TemplateListDialogComponent implements OnInit {
|
||||
private templateService: TemplateService,
|
||||
private formBuilder: FormBuilder,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any,
|
||||
private toasterService: ToasterService
|
||||
private toasterService: ToasterService,
|
||||
private nonNegativeValidator: NonNegativeValidator,
|
||||
) {
|
||||
this.server = data['server'];
|
||||
this.project = data['project'];
|
||||
this.configurationForm = this.formBuilder.group({
|
||||
name: new FormControl('new node', Validators.required),
|
||||
numberOfNodes: new FormControl(1, Validators.required)
|
||||
numberOfNodes: new FormControl(1, [Validators.required, nonNegativeValidator.get])
|
||||
});
|
||||
this.positionForm = this.formBuilder.group({
|
||||
top: new FormControl(0, Validators.required),
|
||||
|
Loading…
Reference in New Issue
Block a user