Edit: interesting discussion on GitHub - Angular
Currently I have a @Component
's template such as
selector: 'app-input',
template: `
<nz-form-item>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input [formControl]="formControl">
</nz-form-control>
</nz-form-item>
`,
This @Component
is then used as
<form nz-form [formGroup]="formGroup">
<app-input [formControlName]="name"></app-input>
<app-input [formControlName]="code"></app-input>
...
However, the NG-ZORRO styles are correctly applied only when the nz-form-item
is directly nested under nz-form
<form nz-form ...
<nz-form-item ...
As of now, instead, the layout is
<form nz-form ...
<app-input ...
<nz-form-item ...
Is there a way to un-wrap the app-input
template?
Or, is there an alternative approach to go for?