Change label dynamically in typescript

I have a function that takes in a string but depending on which type of file is coming in i want my html label to switch between each other

ex:

function changename(food: string){
 if(food){
   this.type = this.getcookiesobservable(food);
   this.type = this.getcakeobservable();
  }
}

how would i get these two to swap and say “cookies” || “cakes”