I am using Angular as front end and Postgresql as database.
The interface below are names of columns in database which are being consumed by service
export interface AmazonDataLog {
customer_id: number;
first_target: string;
last_target: string;
}
Below is the ts file where processIncomingRecord
function will get data and then render on UI
component.ts file
firstLogs: AmazonDataLog | undefined = undefined;
constructor(
public userService: UserService,
private records: AmmaService,
private router: Router
){
this.records.getNextRecord().subscribe(data => {
this.processIncomingRecord(data);
});
Below is html code where data is being displayed
.html code
<mat-divider></mat-divider>
<mat-list-item class="bold">Amazon {{firstLogs.customer_id}} : {{firstLogs.first_target}}</mat-list-item>
<mat-divider></mat-divider>
<mat-divider></mat-divider>
<mat-list-item class="bold">Alexa {{firstLogs.customer_id}} : {{firstLogs.last_target}}</mat-list-item>
<mat-divider></mat-divider>
What I am looking for is to RENAME
backend variable to CAMEL CASE
and display on frontend
Eg - Backend service returns
customer_id: number;
firstTarget: string;
lastTarget: string;
Eg - On UI I want to display as CAMEL CASE
{{customerID}} {{firstTarget}} and {{lastTarget}}
How can I achieve this change?