From 36b20991df8ddb81febf3eebfe6b3e0f8aa59b9e Mon Sep 17 00:00:00 2001 From: vthinkxie Date: Wed, 19 Dec 2018 18:10:14 +0800 Subject: [PATCH] fix(module:radio): fix radio ContentChildren error (#2660) close #2206 close #2611 --- components/radio/nz-radio-group.component.ts | 2 +- components/radio/nz-radio.spec.ts | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/components/radio/nz-radio-group.component.ts b/components/radio/nz-radio-group.component.ts index 8d12acc018b..7e7c7facfe7 100644 --- a/components/radio/nz-radio-group.component.ts +++ b/components/radio/nz-radio-group.component.ts @@ -50,7 +50,7 @@ export class NzRadioGroupComponent implements AfterContentInit, ControlValueAcce private touchedSubscription: Subscription; onChange: (_: string) => void = () => null; onTouched: () => void = () => null; - @ContentChildren(forwardRef(() => NzRadioComponent)) radios: QueryList; + @ContentChildren(forwardRef(() => NzRadioComponent), { descendants: true }) radios: QueryList; @Input() @InputBoolean() nzDisabled: boolean; @Input() nzButtonStyle: NzRadioButtonStyle = 'outline'; @Input() nzSize: NzSizeLDSType = 'default'; diff --git a/components/radio/nz-radio.spec.ts b/components/radio/nz-radio.spec.ts index 93554d7ea5a..a468e7bcead 100644 --- a/components/radio/nz-radio.spec.ts +++ b/components/radio/nz-radio.spec.ts @@ -320,10 +320,12 @@ export class NzTestRadioButtonComponent { selector: 'nz-test-radio-group', template: ` - - - - + + + + + + ` })