fixed model-template add new
This commit is contained in:
parent
bf02c1b99e
commit
141064b38d
@ -1,6 +1,8 @@
|
||||
<h2>Models</h2>
|
||||
|
||||
<rb-icon-button icon="add" mode="primary" (click)="newModel = !newModel" class="space-below">New model</rb-icon-button>
|
||||
<rb-icon-button icon="add" mode="primary" (click)="newModel = !newModel; oldModelGroup = ''" class="space-below">
|
||||
New model
|
||||
</rb-icon-button>
|
||||
|
||||
<form *ngIf="newModel" #modelForm="ngForm">
|
||||
<rb-form-input name="group" label="group" appValidate="string" required [(ngModel)]="modelGroup" #groupInput="ngModel"
|
||||
|
@ -38,7 +38,9 @@ export class ModelTemplatesComponent implements OnInit {
|
||||
}
|
||||
|
||||
saveModel() {
|
||||
if (this.modelGroup !== this.oldModelGroup) { // group was changed, delete model in old group
|
||||
console.log(this.modelGroup);
|
||||
console.log(this.oldModelGroup);
|
||||
if (this.oldModelGroup !== '' && this.modelGroup !== this.oldModelGroup) { // group was changed, delete model in old group
|
||||
this.deleteModel(this.oldModelGroup, this.oldModelName);
|
||||
}
|
||||
this.api.post('/model/' + this.modelGroup, this.model, () => {
|
||||
|
Loading…
Reference in New Issue
Block a user