A value is being returned from my backend as a boolean (true/false) and I need to display it as a string (active/inactive).
if (data['is_active'] == true) {
data['is_active'] = 'active';
this.is_active = data['is_active'];
} else {
data['is_active'] = 'inactive';
this.is_active = data['is_active'];
}
The above code snippet is written in my TypeScript file to handle the condition, however it seems to be not functioning correctly.