forked from angular/components
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmenu-demo.ts
41 lines (37 loc) · 1.19 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
/**
* @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 {MatButtonModule} from '@angular/material/button';
import {MatDividerModule} from '@angular/material/divider';
import {MatIconModule} from '@angular/material/icon';
import {MatMenuModule} from '@angular/material/menu';
import {MatToolbarModule} from '@angular/material/toolbar';
@Component({
selector: 'menu-demo',
templateUrl: 'menu-demo.html',
styleUrl: 'menu-demo.css',
imports: [MatMenuModule, MatButtonModule, MatToolbarModule, MatIconModule, MatDividerModule],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class MenuDemo {
selected = '';
items = [
{text: 'Refresh'},
{text: 'Settings'},
{text: 'Help', disabled: true},
{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;
}
}