Merge pull request #28 in ~VLE2FE/definma-ui from development to master
* commit '141064b38ddf7b75969b0c95aa1c3934a2d60e57': fixed model-template add new
This commit is contained in:
commit
dae482b6d7
@ -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