@Hodrin wrote:
I’am trying to hide a div with a button here’s html code:
<ion-content nopadding> <ion-list> <div *ngIf="DropdownVar === 2 && hideMe" class="dropdown-content"> <button ion-button full (click)="hide()"> Cancelar</button> <ion-item> <ion-label color="primary" stacked>Nome</ion-label> <ion-input type="text" ></ion-input> </ion-item> <ion-item> <ion-label color="primary" stacked> Nif </ion-label> <ion-input type="number" ></ion-input> </ion-item> </div> </ion-list> <button ion-button full (click)="callAll(onSelect())">Inserir exequente</button> </ion-content>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; console.log(x); } callAll() { this.timesClicked++; if (this.timesClicked % 2 == 0) { this.open(); } else { this.onSelect(2); } } hide() { this.hideMe = true; } open() { return console.log('Opened', 3); } }Well if I only use my *ngif=“dropdownVar === 2” it show’s the content of the div, but if i add, the hideME variable in the ngif like this: *ngIf=“DropdownVar === 2 && hideMe”, it hides al the content.
Could u give any tips on hiding a div, thanks in advance?!
Posts: 1
Participants: 1