我有一個調用ngDoCheck(). 該 func 調用了幾個重新分配我的變量的 func。但是變量變化只在函數中發生,而不是全局變量。myVariable總是0。myVariable = 0;ngDoCheck(): any { const word: string = this.form.get('word').value; this.PasswordStrengthMeter(word, this.myVariable); console.log('Value: ' + this.myVariable); }Mainfunc(word: string, myVariable: number): any { this.SecondaryFunc(word, myVariable); this.AnotherSecondaryFunc(word, myVariable); }
如何在angular9中重新分配變量?
呼喚遠方
2023-04-20 17:15:13