DHTMLX Kanban. Angular integration example
This demo shows how to embed DHTMLX Kanban into an Angular application. The Kanban board initializes as a vanilla JavaScript widget inside an Angular component. For a step-by-step setup guide, see the detailed Angular integration guide.
Try it online
View on GitHub. Open the repository and click "Open in Codespaces" on the README page to launch a fully configured Angular app with DHTMLX Kanban. No local setup required.
Solution overview
- Create a custom
KanbanComponent - Use
@ViewChild()decorator with{ static: true }to access DOM elements for Kanban and Toolbar containers - In the
ngOnInitlifecycle hook, initialize Kanban with thenew Kanban(this.kanban_container.nativeElement, { columns, cards, rows, rowKey, cardShape, editorShape, currentUser })constructor - Call the
new Toolbar(this.toolbar_container.nativeElement, { api: this._kanban.api })constructor to create a Toolbar instance and bind it to Kanban - In
ngOnDestroylifecycle hook, calldestructor()to clean up DOM nodes and event listeners for Kanban and Toolbar
API reference
- Kanban constructor: Creates a new Kanban instance
- columns: Defines the board columns
- cards: Defines the task cards
- rows: Defines swimlane rows
- cardShape: Configures which card fields are visible
- editorShape: Configures the card editor fields
- Toolbar: Toolbar widget overview