-
Notifications
You must be signed in to change notification settings - Fork 6.8k
/
Copy pathmenu-demo.ts
63 lines (58 loc) · 1.54 KB
/
menu-demo.ts
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
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {ChangeDetectionStrategy, Component} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {MatButtonModule} from '@angular/material/button';
import {MatCheckboxModule} from '@angular/material/checkbox';
import {MatDividerModule} from '@angular/material/divider';
import {MatIconModule} from '@angular/material/icon';
import {MatMenuModule} from '@angular/material/menu';
import {MatToolbarModule} from '@angular/material/toolbar';
import {MatTooltip} from '@angular/material/tooltip';
@Component({
selector: 'menu-demo',
templateUrl: 'menu-demo.html',
styleUrl: 'menu-demo.css',
imports: [
FormsModule,
MatButtonModule,
MatCheckboxModule,
MatDividerModule,
MatIconModule,
MatMenuModule,
MatToolbarModule,
MatTooltip,
],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class MenuDemo {
selected = '';
disabledInteractive = false;
items = [
{text: 'Refresh'},
{text: 'Settings'},
{
text: 'Help',
disabled: true,
tooltipText: 'This is a menu item tooltip!',
},
{text: 'Sign Out'},
];
iconItems = [
{text: 'Redial', icon: 'dialpad'},
{
text: 'Check voicemail',
icon: 'voicemail',
disabled: true,
},
{text: 'Disable alerts', icon: 'notifications_off'},
];
select(text: string) {
this.selected = text;
}
}