diff --git a/src/material/radio/radio.spec.ts b/src/material/radio/radio.spec.ts index 94f5f98d422f..0d2e0ccb5af4 100644 --- a/src/material/radio/radio.spec.ts +++ b/src/material/radio/radio.spec.ts @@ -1,5 +1,5 @@ import {dispatchFakeEvent} from '@angular/cdk/testing/private'; -import {Component, DebugElement, provideCheckNoChangesConfig, ViewChild} from '@angular/core'; +import {Component, DebugElement, ViewChild} from '@angular/core'; import {ComponentFixture, TestBed, fakeAsync, tick, waitForAsync} from '@angular/core/testing'; import {FormControl, FormsModule, NgModel, ReactiveFormsModule} from '@angular/forms'; import {By} from '@angular/platform-browser'; @@ -14,7 +14,6 @@ import { describe('MatRadio', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - providers: [provideCheckNoChangesConfig({exhaustive: false})], imports: [ MatRadioModule, FormsModule, diff --git a/src/material/radio/radio.ts b/src/material/radio/radio.ts index 61e2df4c60fb..7a545cdd0f33 100644 --- a/src/material/radio/radio.ts +++ b/src/material/radio/radio.ts @@ -523,6 +523,9 @@ export class MatRadioButton implements OnInit, AfterViewInit, DoCheck, OnDestroy return this._required || (this.radioGroup && this.radioGroup.required); } set required(value: boolean) { + if (value !== this._required) { + this._changeDetector.markForCheck(); + } this._required = value; }