fixed model-template add new
This commit is contained in:
		@@ -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, () => {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user