How to hide a div with a button?

I’am trying to hide a div with a button, but unfortunately it doesn’t seem to work

Here’s html code:

<ion-content nopadding>

    <div *ngIf="DropdownVar === 2 || hideMe" class="dropdown-content">
        <button ion-button full (click)="hide()"> Cancelar</button>
            <ion-label color="primary" stacked>Nome</ion-label>
            <ion-input type="text" ></ion-input>
            <ion-label color="primary" stacked> Nif </ion-label>
            <ion-input type="number" ></ion-input>
    <button ion-button full (click)="callAll(onSelect())">Inserir exequente</button>

Here’s my typescript:

export class ExequentesPage {

  model = new Processos();
  DropdownVar = 0;
  x = 2;
  timesClicked = 0;
  hideMe = false;

  constructor(public navCtrl: NavController, public navParams: NavParams, public processoProvider: ProcessosProvider) {


  ionViewDidLoad() {
    console.log('ionViewDidLoad ExequentesPage');


  onSelect(x) {
    this.DropdownVar = x;

  callAll() {

    if (this.timesClicked % 2 == 0) {;
    } else {

  hide() {
    this.hideMe = true;

  open() {
    return console.log('Opened', 3);


Could u give any tips on hiding a div, thanks in advance?!

ngif put an element in the dom or not. If not, then there is nothing you can hide.
Use [hidden]=‘hideMe’ to hide or show an element.

Best regards, anna-liebt