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
Bug
The radio button is updated when markForCheck is called
The radio button is one value behind
import { Component, ChangeDetectorRef, ChangeDetectionStrategy } from '@angular/core';
@component({ selector: 'dm-settings', templateUrl: '../../views/game/settings.html', changeDetection: ChangeDetectionStrategy.OnPush }) export class SettingsComponent { private value: boolean = false;
constructor(private change: ChangeDetectorRef) { setTimeout(() => { this.value = !this.value; this.change.markForCheck(); }, 1000); }
}
<md-card> {{value}} <md-radio-group [(ngModel)]="value"> <md-radio-button [value]="true">true</md-radio-button> <md-radio-button [value]="false">false</md-radio-button> </md-radio-group> </md-card>
"@angular/common": "^2.4.1", "@angular/core": "^2.4.1", "@angular/material": "^2.0.0-beta.1", "@angular/platform-browser": "^2.4.1", "@angular/platform-browser-dynamic": "^2.4.1", "@angular/forms": "^2.4.1",
The text was updated successfully, but these errors were encountered:
There might be a separate issue for the OnPush bug, might be a dupe.
Sorry, something went wrong.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
Successfully merging a pull request may close this issue.
Bug, feature request, or proposal:
Bug
What is the expected behavior?
The radio button is updated when markForCheck is called
What is the current behavior?
The radio button is one value behind
What are the steps to reproduce?
component
import { Component, ChangeDetectorRef, ChangeDetectionStrategy } from '@angular/core';
@component({
selector: 'dm-settings',
templateUrl: '../../views/game/settings.html',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class SettingsComponent {
private value: boolean = false;
constructor(private change: ChangeDetectorRef) {
setTimeout(() => {
this.value = !this.value;
this.change.markForCheck();
}, 1000);
}
}
template
<md-card>
{{value}}
<md-radio-group [(ngModel)]="value">
<md-radio-button [value]="true">true</md-radio-button>
<md-radio-button [value]="false">false</md-radio-button>
</md-radio-group>
</md-card>
What is the use-case or motivation for changing an existing behavior?
Which versions of Angular, Material, OS, browsers are affected?
Is there anything else we should know?
The text was updated successfully, but these errors were encountered: