alfresco-ng2-components/docs/core/directives/context-menu.directive.md
Eugenio Romano 1c51b2a1a6
Use hash strategy in demo shell as the other apps (#6402)
* hash startegy

* use hash in e2e

* trigger build

* fix

* fix

* remove children router overwrite crazynes

* Update login.module.ts

* revert not needed changes

* some fixes

* fix

* remove fdescribe

* fix

* fix

* Update share-file.e2e.ts

* Update lock-file.e2e.ts

* Update share-file.e2e.ts

* some fix

* some other fixes

* username as id

* fix after rebase

* username

* fix usernamee

* Fix the errorComponent

* Attempt to fix unit test - to check

* * Fixed circular dependency error while building adf-testing package

* * Fixed failing UT

* fix

* use username

* some fixes

* some fix

* fix

Co-authored-by: Maurizio Vitale <maurizio.vitale@alfresco.com>
Co-authored-by: Vito Albano <vitoalbano@vitoalbano-mbp-0120.local>
Co-authored-by: sivakumar414ram <siva.kumar@muraai.com>
2020-12-16 18:46:56 +00:00

1.3 KiB

Title, Added, Status, Last reviewed
Title Added Status Last reviewed
Context Menu directive v2.0.0 Deprecated 2018-11-20

Context Menu directive

Adds a context menu to a component.

Basic Usage

<my-component [adf-context-menu]="menuItems"></my-component>
<adf-context-menu-holder></context-menu-holder>
@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.`);
    }

}

Class members

Properties

Name Type Default value Description
enabled boolean false Is the menu enabled?
links any[] Items for the menu.

Details

See the Demo Shell or Document List component implementation for more details and use cases.