Skip to content

Commit

Permalink
CHORE: Slightly opimized code
Browse files Browse the repository at this point in the history
  • Loading branch information
davidibl committed Apr 1, 2020
1 parent 6a31b37 commit ac5e055
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/app/components/dataModelEditor/dataModelEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,18 @@ import { filter, take } from 'rxjs/operators';
templateUrl: 'dataModelEditor.html',
styleUrls: ['dataModelEditor.scss'],
})
export class DataModelEditorComponent implements OnInit {
export class DataModelEditorComponent {

public editorTypes = EditorType;

public responseModel$: Observable<ObjectDefinition>;
public requestModel$: Observable<ObjectDefinition>;
public requestModelsExceptCurrent$: Observable<string[]>;
public requestModelReferenced$: Observable<string>;
public responseModel$ = this._dataModelService.getResponseModel();
public requestModel$ = this._dataModelService.getDataModel();
public requestModelsExceptCurrent$ = this._dataModelService.getDataModelsExceptCurrent();
public requestModelReferenced$ = this._dataModelService.getCurrentDataModelReference();

public constructor(private _dataModelService: DataModelService,
private _eventService: EventService) {}

public ngOnInit() {
this.requestModel$ = this._dataModelService.getDataModel();
this.responseModel$ = this._dataModelService.getResponseModel();
this.requestModelsExceptCurrent$ = this._dataModelService.getDataModelsExceptCurrent();
this.requestModelReferenced$ = this._dataModelService.getCurrentDataModelReference();
}

public onNewModelCreated(requestModel: ObjectDefinition) {
this._eventService.publishEvent(new DataChangedEvent(DataChangeType.DATAMODEL));
this._dataModelService.newDataModel(requestModel);
Expand Down

0 comments on commit ac5e055

Please sign in to comment.