I'm new to typescript so please bare with me. I got a program that produces a website with a UI built in. The UI consists of a textbox that takes a vin number, stores it, then passes on to the backend java program to do some backend processes. And the code worked fine. However, the program is being repurposed to use arbitration numbers instead. So I simply replaced all references of "vin" to "Arbitration" instead but I get this error
"ERROR in src\app\buyback\buyback.component.html(6,32): : Property 'Arbitration' does not exist on type 'BuybackComponent'."
And this is the code it's referencing
<td class="elt"><label class="title">Enter an Arbitration Number</label></td>
<td class="elt"><input (input)="Arbitration=$event.target.value" type="text" class="form-control"></td>
......
<td class="submit"><button type="button" class="btn btn-success" (click)="getBuyback()">Submit</button></td><td></td>
I'm not exactly sure if there's another file where I need to define Arbitration before I can use it here for the textbox to accept whatever is inputted and pass it through the program but I could use some assistance.
Bits of other files that got vin modified and changed to Arbitration ...:
buyback.service.ts
.....
constructor(private http: HttpClient) { }
public getBuybackType() : Observable<BuybackType>{
return this.http.get<BuybackType>(this._bturl);
}
public getBuyback(Arbitration:String, buybackType: String ) : Observable<BuybackResponse>{ //modified
console.log("ENV URL: " + this._url);
console.log("Arbitration " + Arbitration); //modified
console.log("buybackType " + buybackType);
return this.http.post<BuybackResponse>(this._url, {
"Arbitration" : Arbitration, //modified
"buybackType": buybackType
});
}
}
buyback.component.ts
constructor(private _buybackService: BuybackService, private router: Router, private location: Location) { }
Arbitration:String; //modified
bType:String;
optionValue:String;
public sdata: BuybackResponse;
public bdata: BuybackType;
ngOnInit() {
if (sessionStorage.length == 0) {
this.location.replaceState('/');
this.router.navigate(['/']);
}
this._buybackService.getBuybackType().subscribe(data => this.bdata = data);
}
setType(e){
this.bType=e.target.value;
}
getBuyback() {
this._buybackService.getBuyback(this.Arbitration, this.bType).subscribe(data => this.sdata = data); //this arbitration modified
}
}