let access = environment.access.find(it => it.roleName == userRole);
Property 'filter' does not exist on type '{ siteadmin: string[]; manager: string[]; employee: string[]; contractor: any[]; }'.
This scenario should work perfectly, but I am puzzled by the error that appears when running ng build or ng serve
Currently utilizing Angular 13
From Environment.ts:
export const environment = {
production: false,
baseUrl:"https://localhost:5001/api/",
access: [{
roleName:"siteadmin",
access:['page1','home', 'usermanagement']
},
{
roleName:"manager",
access:['home']
},
{
roleName:"employee",
access:['page1','home']
},
{
roleName:"contractor",
access:['page1','home', 'usermanagement']
}
],
};
The access variable is an array of objects