I am creating an application in Angular and I want to change the value of variable through a service #function.ts
hide(menu) {
  console.log(menu)
  if (menu == true) {
    menu = false
  } else {
    menu = true
  }
}
main-component.ts
hide_menu() {
    hide(this.menu)
  }
In this case, I could see in the console that the menu is true but the value will not change.
 
     
     
    