I want to access this "code:ENABLE_CO" in angular I have tried, the following code nothing has been worked for me. for your reference i have attached the image, anyone please help me out for this
it is the dynamic one . and i need both the key and value and the structure may differ.
if(user.authorizations)
{
user.authorizations.forEach(obj=>
{
for (const [key, value] of Object.entries(obj))
{
console.log(key);
console.log(value);
if(value=="ENABLE_COMPANY_CODE")
{
console.log("value is"+value);
}
}
})
}
=

user.authorizationslook like?user.authorizationsarray (i.e. that it will havescreensandfunctionalities) and you can also havecodekey in upper-level objects (i.e. not the ones you're looking for), it might be a good idea to use for loops to iterate over objects, then if clause to test it if hasscreens, then for-loop again to iterate over screens objects and check if they havefunctionalities, then iterate again through functionalities objects and find the value of thecode.