Drawer Component - Custom title and extra #9326
Answered
by
FrogDevelopper
FrogDevelopper
asked this question in
Q&A
-
Hello, I would like to customized the Title and Extra of the Drawer, when using it as a Component |
Beta Was this translation helpful? Give feedback.
Answered by
FrogDevelopper
Aug 13, 2025
Replies: 1 comment 2 replies
-
I have partially resolved it: export class MyDrawerComponent implements OnInit, AfterViewInit {
private readonly drawerRef:NzDrawerRef<MyDrawerComponent, IDrawerResult> = inject(NzDrawerRef<MyDrawerComponent, IDrawerResult>)
@ViewChild('headerTpl') headerTpl!: TemplateRef<any>;
@ViewChild('footerTpl') footerTpl!: TemplateRef<any>;
readonly nzData: IDrawerData = inject(NZ_DRAWER_DATA);
ngAfterViewInit(): void {
this.drawerRef.nzTitle = this.headerTpl; // <=== THIS WORKS :)
this.drawerRef.nzFooter = this.footerTpl; // <=== THIS DOES NOT WORK! :'(
} Why there is no field |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
OK, I've finally found how
We just have to use
instead of
NzDrawerRef