Skip to content

md-radio with push strategy not updateing #2491

Closed
@droppedcode

Description

@droppedcode

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2The issue is important to a large percentage of users, with a workaround

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions