Skip to content Skip to sidebar Skip to footer

Show Hide In Ionic Framework

I want a show hide function for my ionic app: Below is what I have done so far, in xyz.html file:

Copy

TS

import { Component, Renderer2 } from '@angular/core';
import { NavController } from 'ionic-angular';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {

public items: string[] = [
    "Item 1",
    "Item 2",
    "Item 3",
    "Item 4",
    "Item 5",
    "Item 6",
    "Item 7",
    "Item 8",
    "Item 9",
    "Item 10",   
];

  public PtagClicked: boolean = false;

  constructor(public navCtrl: NavController, private render: Renderer2) { }

  public onShow(controlToShow) {
    this.render.setStyle(controlToShow, 'visibility', 'visible');
  }
  public onHide(controlToHide) {
    this.render.setStyle(controlToHide, 'visibility', 'hidden');
  }

}

Post a Comment for "Show Hide In Ionic Framework"