-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.component.ts
More file actions
76 lines (67 loc) · 1.67 KB
/
Copy pathapp.component.ts
File metadata and controls
76 lines (67 loc) · 1.67 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import { Component } from '@angular/core';
import notify from 'devextreme/ui/notify';
import { DxButtonTypes } from 'devextreme-angular/ui/button';
import { DxTextBoxTypes } from 'devextreme-angular/ui/text-box';
type ToolbarButtonOptions = DxButtonTypes.Properties;
type SearchBoxOptions = DxTextBoxTypes.Properties;
import { DxToolbarModule } from 'devextreme-angular/ui/toolbar';
@Component({
selector: 'app-root',
imports: [DxToolbarModule],
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
})
export class AppComponent {
backButtonOptions: ToolbarButtonOptions = {
icon: 'back',
onClick: () => {
this.showMessage('Back');
},
};
textBoxOptions: SearchBoxOptions = {
placeholder: 'Search...',
showClearButton: true,
};
searchButtonOptions: ToolbarButtonOptions = {
icon: 'search',
onClick: () => {
this.showMessage('Search');
},
};
aboutButtonOptions: ToolbarButtonOptions = {
icon: 'info',
text: 'About',
onClick: () => {
this.showMessage('About');
},
};
profileButtonOptions: ToolbarButtonOptions = {
icon: 'user',
text: 'Profile',
onClick: () => {
this.showMessage('Profile');
},
};
settingsButtonOptions: ToolbarButtonOptions = {
icon: 'preferences',
text: 'Settings',
onClick: () => {
this.showMessage('Settings');
},
};
private showMessage(name: string): void {
notify(
{
message: `${name} button has been clicked!`,
width: 300,
position: {
my: 'bottom',
at: 'bottom',
of: '#app-container',
},
},
'info',
500,
);
}
}