mercredi 21 septembre 2016

how to update a value inside the if condition

i have situation where checknotificationObj="true" (i.e _this.noteValue="ture" ) as you can see below.

now how to make that _this.noteValue =false when it enters the if condtion in .ts . this same visiversa for else part

I am new to angular2 help me please

let checkNotifictionObj = _this.noteValue;
     if(checkNotifictionObj){
        notificationDetails={
          notification:"flase"
        };
       _this.noteValue="false";
     }
     else{
       notificationDetails={
         notification:"true"
       };
       _this.noteValue="true";
     }

i am not able to update checkNotifictionObj true to false and false to true

Aucun commentaire:

Enregistrer un commentaire