When using a custom pipe that returns a string based on certain conditions, it seems to always return the first result even when the conditions are not met. However, when the same if/else statements are used in a method, it works fine.
transform(orderType: String, completed: Boolean, requestType: String): any{
if (completed && orderType !== 'web') {
console.log('1');
return 'not web';
} else if (completed && orderType === 'web') {
console.log('2');
return 'web';
} else {
return 'N/A';
}
}
Here is the part where it's being called:
{{ this.orderType| getOrderType: this.order.requestType: this.completed}} {{this.order.requestType}}
Although the requestType and completed variables are logging correctly in the console, the pipe still returns 'not web' even when it should be 'web'.