We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
16.1.0
16.2.12
html:
<d-toggle name="test" [size]="'sm'" [color]="color.button_color" [(ngModel)]="formData['test']" (change)="toggleChange($event)"></d-toggle>
ts:
formData = { test: false, }; toggleChange($event: boolean) { console.log('$event: ', $event); console.log('test: ', this.formData['test']); }
使用双向绑定后, 用 change 事件绑定 toggleChange 方法, 点击按钮, 查看绑定值是否改变, 发现在 change 事件中双向绑定的值没有改变. 结果: $event: true test: false
$event: true test: true
No response
The text was updated successfully, but these errors were encountered:
change事件触发在ngModel变化触发之前,这两个不要混用,你想用本地双绑值用ngModelChanges
Sorry, something went wrong.
No branches or pull requests
Version
16.1.0
Angular Version
16.2.12
Link to minimal reproduction
html:
ts:
Step to reproduce
使用双向绑定后, 用 change 事件绑定 toggleChange 方法, 点击按钮, 查看绑定值是否改变, 发现在 change 事件中双向绑定的值没有改变.
结果:
$event: true
test: false
What is expected
$event: true
test: true
What is actually happening
No response
Any additional comments (optional)
No response
The text was updated successfully, but these errors were encountered: