我有一个调用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);
}
精慕HU
郎朗坤
相关分类