File
Constructor
constructor(navParams: NavParams, popoverCtrl: PopoverController)
|
|
Parameters :
Name |
Type |
Optional |
navParams |
NavParams
|
No
|
popoverCtrl |
PopoverController
|
No
|
|
Methods
open
|
open(event, item)
|
|
Parameters :
Name |
Optional |
event |
No
|
item |
No
|
|
items
|
Type : Array<string>
|
|
profile
|
Type : any
|
Default value : {}
|
|
import { Component } from '@angular/core';
import { NavParams, PopoverController } from '@ionic/angular';
@Component({
selector: 'app-overflow-menu',
templateUrl: './overflow-menu.component.html',
styleUrls: ['./overflow-menu.component.scss'],
})
export class OverflowMenuComponent {
items: Array<string>;
profile: any = {};
constructor(
private navParams: NavParams,
private popoverCtrl: PopoverController
) {
this.items = this.navParams.get('list');
this.profile = this.navParams.get('profile') || {};
}
showToast() {
this.items = this.navParams.get('list') || [];
}
open(event, item) {
this.popoverCtrl.dismiss({
content: event.target.innerText,
selectedItem: item
});
}
}
<ion-list lines="none">
<ion-item role="button" *ngFor="let item of items,let i = index" (click)="open($event, item)">
<label class="ellipsis">{{item | translate }}</label></ion-item>
</ion-list>
@import "src/assets/styles/base/_variables.scss";
:host {
ion-list {
padding: 0;
ion-item {
--min-height: 2.5rem;
--padding-start: 8px;
--padding-end: 0;
}
}
}
Legend
Html element with directive