-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathapp.component.ts
More file actions
30 lines (26 loc) · 877 Bytes
/
app.component.ts
File metadata and controls
30 lines (26 loc) · 877 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { Component } from '@angular/core';
import notify from 'devextreme/ui/notify';
import { DxDropDownButtonTypes } from 'devextreme-angular/ui/drop-down-button';
import { ActionItem, DropDownOptions } from './app.types';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
})
export class AppComponent {
actions: ActionItem[] = [
{ id: 1, text: 'My profile', icon: 'user' },
{ id: 2, text: 'Messages', icon: 'email' },
{ id: 3, text: 'Contacts', icon: 'group' },
{ id: 4, text: 'Log out', icon: 'runner' },
];
dropDownOptions: DropDownOptions = {
height: 150,
};
onItemClick(e: DxDropDownButtonTypes.ItemClickEvent): void {
notify(`${e.itemData.text} was clicked`, 'info', 2000);
}
onButtonClick(): void {
notify('Main button was clicked', 'success', 2000);
}
}