mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2463] Moved doc files to subfolders (#3070)
* [ADF-2463] Moved doc files to subfolders * [ADF-2463] Fixed broken image links * [ADF-2463] Moved doc files to subfolders * [ADF-2463] Fixed broken image links
This commit is contained in:
committed by
Eugenio Romano
parent
d4780d41ce
commit
ba905acf13
51
docs/core/context-menu.directive.md
Normal file
51
docs/core/context-menu.directive.md
Normal file
@@ -0,0 +1,51 @@
|
||||
---
|
||||
Added: v2.0.0
|
||||
Status: Active
|
||||
---
|
||||
# Context Menu directive
|
||||
|
||||
Adds a context menu to a component.
|
||||
|
||||
## Basic Usage
|
||||
|
||||
```html
|
||||
<my-component [context-menu]="menuItems"></my-component>
|
||||
<context-menu-holder></context-menu-holder>
|
||||
```
|
||||
|
||||
```ts
|
||||
@Component({
|
||||
selector: 'my-component'
|
||||
})
|
||||
export class MyComponent implements OnInit {
|
||||
|
||||
menuItems: any[];
|
||||
|
||||
constructor() {
|
||||
this.menuItems = [
|
||||
{ title: 'Item 1', subject: new Subject() },
|
||||
{ title: 'Item 2', subject: new Subject() },
|
||||
{ title: 'Item 3', subject: new Subject() }
|
||||
];
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.menuItems.forEach(l => l.subject.subscribe(item => this.commandCallback(item)));
|
||||
}
|
||||
|
||||
commandCallback(item) {
|
||||
alert(`Executing ${item.title} command.`);
|
||||
}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default | Description |
|
||||
| ---- | ---- | ------- | ----------- |
|
||||
| showIcons | boolean | false | Render defined icons |
|
||||
|
||||
## Details
|
||||
|
||||
See **Demo Shell** or **DocumentList** implementation for more details and use cases.
|
Reference in New Issue
Block a user