dashboard-402086-web-dashboard-integrate-dashboard-component-dashboard-component-for-angular-handle-events.md
Use the () syntax to handle an event and pass the $event object to listen the event.
The following code handles the onDashboardInitialized event and shows the dashboard identifier in a toast message:
<dx-dashboard-control
(onDashboardInitialized) = "onDashboardInitialized($event)"
>
</dx-dashboard-control>
import { Component } from "@angular/core";
import notify from "devextreme/ui/notify";
// ...
export class AppComponent {
onDashboardInitialized(args) {
notify(args.dashboardId);
}
}
In nested components, the () syntax cannot be used. Use the [] syntax instead.
The following code hides the CategoryName column from the Data Inspector‘s grid:
<dx-dashboard-control>
<dxo-extensions>
<dxo-data-inspector
[onGridContentReady] = 'onGridContentReady'>
</dxo-data-inspector>
</dxo-extensions>
</dx-dashboard-control>
export class AppComponent {
onGridContentReady (args) {
args.component.columnOption("CategoryName", "visible", false);
}
}
Tip
DevExtreme Documentation : Event Handling
Angular Documentation : Event Binding