Variable is initialized again after the input value changes in angular

I have a shared component with some input values and one declared variable. The input values of the component change in between and whenever the input value changes, showItems is declared again and it’s value is false.
I tried to use behavior subject, but it doesn’t solve my problem. Is there any better workaround for this one?

Code:

export class Component{
    @Input() input1: boolean;
    @Input() input2: string[];

    showItems: boolean;

    constructor() {}

    toggleItems() {
        this.showItems= !this.showItems;
    }
}