-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add AppComponent inputs/outputs
Add inputs and outputs so that a custom element user can interact with NGE. A netzgrafikDto input is introduced to get/set the data service's current DTO. A operation output is introduced to notify about DTO changes. The changes are described by a new Operation class. Co-authored-by: Simon Ser <[email protected]>
- Loading branch information
1 parent
cc4c56b
commit f0cea11
Showing
4 changed files
with
79 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import {Trainrun} from "./trainrun.model"; | ||
import {TrainrunSection} from "./trainrunsection.model"; | ||
|
||
enum OperationType { | ||
create = "create", | ||
update = "update", | ||
delete = "delete" | ||
} | ||
|
||
export abstract class Operation { | ||
readonly type: OperationType; | ||
|
||
constructor(type: OperationType) { | ||
this.type = type; | ||
} | ||
} | ||
|
||
export class CreateTrainrunOperation extends Operation { | ||
readonly trainrunSection: TrainrunSection; | ||
|
||
constructor(trainrunSection: TrainrunSection) { | ||
super(OperationType.create); | ||
this.trainrunSection = trainrunSection; | ||
} | ||
} | ||
|
||
export class UpdateTrainrunSectionsOperation extends Operation { | ||
readonly trainrunSections: TrainrunSection[]; | ||
|
||
constructor(trainrunSections: TrainrunSection[]) { | ||
super(OperationType.update); | ||
this.trainrunSections = trainrunSections; | ||
} | ||
} | ||
|
||
export class DeleteTrainrunOperation extends Operation { | ||
readonly trainrun: Trainrun; | ||
|
||
constructor(trainrun: Trainrun) { | ||
super(OperationType.delete); | ||
this.trainrun = trainrun; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters