File

src/app/profile/overflow-menu/overflow-menu.component.ts

Metadata

Index

Properties
Methods

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
Returns : void
showToast
showToast()
Returns : void

Properties

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>

./overflow-menu.component.scss

@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
Component
Html element with directive

results matching ""

    No results matching ""