new-is-app-angular2 #12
|
@ -6,12 +6,12 @@
|
|||
|
||||
<mat-form-field appearance="fill" style="width: 100%;">
|
||||
<mat-label>ID</mat-label>
|
||||
<input matInput required readonly value="{{data.id}}"/>
|
||||
<input matInput readonly value="{{data.id}}"/>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field appearance="fill" style="width: 100%;">
|
||||
<mat-label>Content ({{data.contentType}})</mat-label>
|
||||
<textarea matInput formControlName="content" rows="16" required style="font-size: 0.8em;"></textarea>
|
||||
<textarea matInput formControlName="content" required rows="16" style="font-size: 0.8em;"></textarea>
|
||||
<mat-error *ngIf="contentForm.get('content')?.invalid">This field is <strong>required</strong></mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
|
|
@ -5,14 +5,12 @@
|
|||
|
||||
<mat-form-field appearance="fill" style="width: 100%;">
|
||||
<mat-label>ID</mat-label>
|
||||
<input matInput formControlName="id" required readonly />
|
||||
<mat-error *ngIf="metadataForm.get('id')?.invalid">This field should not be empty</mat-error>
|
||||
<input matInput readonly value="{{data.id}}"/>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field appearance="fill" style="width: 100%;">
|
||||
<mat-label>Type</mat-label>
|
||||
<input matInput formControlName="type" required readonly />
|
||||
<mat-error *ngIf="metadataForm.get('type')?.invalid">This field should not be empty</mat-error>
|
||||
<input matInput readonly value="{{data.type}}" />
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field appearance="fill" style="width: 100%;">
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
<mat-form-field appearance="fill" style="width: 100%;">
|
||||
<mat-label>Content ({{data.contentType}})</mat-label>
|
||||
<textarea matInput formControlName="content" rows="10" required style="font-size: 0.8em;"></textarea>
|
||||
<textarea matInput formControlName="content" required rows="10" style="font-size: 0.8em;"></textarea>
|
||||
<mat-error *ngIf="newResourceForm.get('content')?.invalid">This field is <strong>required</strong></mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ export class ResourcesComponent implements OnInit {
|
|||
styleUrls: ['resources.component.css']
|
||||
})
|
||||
export class ResContentDialog {
|
||||
contentFormControl = new FormControl('', [Validators.required]);
|
||||
contentFormControl = new FormControl('');
|
||||
|
||||
contentForm = new FormGroup({
|
||||
content : this.contentFormControl
|
||||
|
@ -145,15 +145,11 @@ export class ResContentDialog {
|
|||
})
|
||||
export class ResMetadataDialog {
|
||||
metadataForm = new FormGroup({
|
||||
id: new FormControl('', [Validators.required]),
|
||||
type: new FormControl('', [Validators.required]),
|
||||
name: new FormControl('', [Validators.required]),
|
||||
description : new FormControl('', [])
|
||||
name: new FormControl(''),
|
||||
description : new FormControl('')
|
||||
});
|
||||
|
||||
constructor(public dialogRef: MatDialogRef<ResMetadataDialog>, @Inject(MAT_DIALOG_DATA) public data: any, public service: ISService) {
|
||||
this.metadataForm.get('id')?.setValue(data.id);
|
||||
this.metadataForm.get('type')?.setValue(data.type);
|
||||
this.metadataForm.get('name')?.setValue(data.name);
|
||||
if (data.description) {
|
||||
this.metadataForm.get('description')?.setValue(data.description);
|
||||
|
@ -184,9 +180,9 @@ export class ResMetadataDialog {
|
|||
})
|
||||
export class ResCreateNewDialog {
|
||||
newResourceForm = new FormGroup({
|
||||
name: new FormControl('', [Validators.required]),
|
||||
description : new FormControl('', []),
|
||||
content : new FormControl('', [Validators.required])
|
||||
name: new FormControl(''),
|
||||
description : new FormControl(''),
|
||||
content : new FormControl('')
|
||||
});
|
||||
|
||||
constructor(public dialogRef: MatDialogRef<ResCreateNewDialog>, @Inject(MAT_DIALOG_DATA) public data: any, public service: ISService) {}
|
||||
|
|
Loading…
Reference in New Issue