In my Angular asp.net core web api project, I am looking to implement dynamic buttons. Specifically, when the status of a product is "Z", I need to disable the add, edit, and delete functionality.
I have a method that works for this scenario, but I am unsure of how to apply it in a different case. Here is an example of the method in action:
Component.service.ts
getDisabledAddEditDel(model:Component,mode: string)
{
if(model && mode != 'View' && mode !='Add' && model.StatusOfProduct === 'Z')
{
return false;
}
return true;
}
In the above case, the StatusOfProduct is available in the model Component. However, in the second case, the StatusOfProduct is not present in the model. How can I access the StatusOfProduct from the Component in another service or model without directly adding it to the second model?
Thank you.