I have an application in which you can add or edit values to a database.
I want to make it so that when I set one parameter to anything (it is empty by default) the second parameter gets set to a specific value.
Further explanation on what I'm actually trying to do:
HTML code:
<form class=form-group>
<td><label>Status Code</label></td>
<input type="text" #StatusCode (ngModel)="StatusCodes" value="{{StatusCodes}}">
</form>
<form class=form-group>
<td><label>Eta</label></td>
<input type="text" #Eta (ngModel)="Etas" value="{{Etas}}">
</form>
<form class=form-group>
<td><label>Etd</label></td>
<input type="text" #Etd (ngModel)="Etds" value="{{Etds}}">
</form>
<form class=form-group>
<td><label>Ata</label></td>
<input type="text" #Ata (ngModel)="Atas" value="{{Atas}}">
</form>
<form class=form-group>
<td><label>Atd</label></td>
<input type="text" #Atd (ngModel)="Atds" value="{{Atds}}">
</form>
The StatusCodes
has a default value of "announced" and only Eta
has a specified value (other 3 are empty). Upon entering a value for Ata
I want to have the StatusCodes
value to automatically be set to "inport".
I'm guessing ngswitch could be used in this situation but I don't know how. What would be the syntax for it in this case?
If there's better way to get this behaviour please advise me on how I'd achieve this.