In my code, there exists an abstract class named DynamicGridClass
, containing an optional property called showGlobalActions?: boolean?
. This class serves as the blueprint for another component called MatDynamicGridComponent
, which is a child component. Inside MatDynamicGridComponent
, I have declared an @Input()
property known as
showGlobalActions: boolean = true.
When I include the MatDynamicGridComponent
in my HTML and pass a value to it like so:
[showGlobalActions]="false"
, it correctly takes on that value. If no value is explicitly provided, it defaults to true based on the initial declaration of @Input() showGlobalActions: boolean = true.
The problem only arises when I load MatDynamicGridComponent
using routing. In such instances, the showGlobalActions
variable ends up being undefined.
{
path: 'auth/resources',
children: [
{
path: '',
component: MatDynamicGridComponent,
data: {
title: 'resources',
gridId: 'admin_auth_resource'
},
},
{
path: 'resources-form/:mode',
component: AuthResourcesFormComponent,
data: {
title: 'resources-form'
}
}
]
}
Upon loading MatDynamicGridComponent
through routing, the showGlobalActions
variable is displayed as undefined.