src/app/manage-learn/shared/components/popover/popover.component.ts
selector | app-popover |
styleUrls | ./popover.component.scss |
templateUrl | ./popover.component.html |
Methods |
Inputs |
menus | |
Type : any
|
|
onEvent | ||||
onEvent(menu)
|
||||
Parameters :
Returns :
void
|
import { Component, Input } from '@angular/core';
import { popoverController } from '@ionic/core';
@Component({
selector: 'app-popover',
templateUrl: './popover.component.html',
styleUrls: ['./popover.component.scss'],
})
export class PopoverComponent {
@Input() menus;
onEvent(menu) {
popoverController.dismiss(menu.VALUE);
}
}
<ion-list>
<ion-item *ngFor="let menu of menus" (click)="onEvent(menu)">
<ion-label class="menu-label">{{menu.TITLE | translate}}
</ion-label>
<ion-avatar slot="end" class="avatar-style" *ngIf="menu.ICON">
<ion-icon [name]="menu.ICON"></ion-icon>
</ion-avatar>
</ion-item>
</ion-list>
./popover.component.scss
.menu-label{
font-size: 1rem;
}
.avatar-style{
display: contents;
font-size: 1.75rem;
}