/* Copyright © 2016-2019 Lidor Systems. All rights reserved. This file is part of the "IntegralUI Web" Library. The contents of this file are subject to the IntegralUI Web License, and may not be used except in compliance with the License. A copy of the License should have been installed in the product's root installation directory or it can be found at http://www.lidorsystems.com/products/web/studio/license-agreement.aspx. This SOFTWARE is provided "AS IS", WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. Any infringement will be prosecuted under applicable laws. */ import { Component, ViewContainerRef, ViewChild, ViewChildren, ViewEncapsulation } from '@angular/core'; @Component({ selector: '', template: `
This example shows how to create menu items with custom content in Menu component.
For this purpose, you can use templates and based on menu item, add different HTML elements or other Angular components. In this case, the Menu has two custom menu items:
To simplify the example, when edit button is clicked, a popup message will appear stating the button that is clicked. You can replace this by adding real edit operations.
When you need to change a value while keeping the menu open, you need to call the stopPropagation method from within fired event of the menu item element. If the menu item label is clicked, the menu will also close. For example, click on +/- buttons to change the zoom level, when finished, just click on the 'Zoom' label.
For more information check out the source code of this sample (menu/menu-templates.ts) file.