When I update this.showPlan = true; i guess it is not updatiing globally because when clicking on document it is still showing as false instead of true
This is my HTML code:
<li (click)="displayPlanWidget()"></li>
<div style="display: none;" id="planTabInput">----</div>
This is my type script code:
public showPlan:boolean = false; //For showPlan
ngOnInit() {
var arg1 = this.showPlan;
var arg2 = this.showAccount;
console.log('arg1--------'+arg1); //coming fine on initial
jQuery(document).click({showPlan:arg1},function(e) {
console.log('showPlan--------'+e.data.showPlan); //coming as false insted true
if(e.data.showPlan != 'false') { //this should trigger (not triggering because it is not updating to true)
jQuery("#planTabInput").css( "display",'none' );
}
});
}
public displayPlanWidget() {
this.showPlan = true;
console.log('showPlan Changed to '+this.showPlan); //coming true(fine)
jQuery("#planTabInput").show();
}
Where I am doing wrong help is appreciated.