Skip to content
New issue

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

md-radio with push strategy not updateing #2491

Closed
droppedcode opened this issue Jan 2, 2017 · 2 comments · Fixed by #2526
Closed

md-radio with push strategy not updateing #2491

droppedcode opened this issue Jan 2, 2017 · 2 comments · Fixed by #2526
Labels
P2 The issue is important to a large percentage of users, with a workaround

Comments

@droppedcode
Copy link

droppedcode commented Jan 2, 2017

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?

"@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",

Is there anything else we should know?

@jelbourn jelbourn added the P2 The issue is important to a large percentage of users, with a workaround label Jan 4, 2017
@jelbourn
Copy link
Member

jelbourn commented Jan 4, 2017

There might be a separate issue for the OnPush bug, might be a dupe.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P2 The issue is important to a large percentage of users, with a workaround
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants