Reputation: 2276
I am working on Angular formly with Angular Material. My question is how to arrange two input boxes side by side without writing any external CSS? With AngularJS we have an option to arrange the layout like so. But I didn't figure out how to do that with Angular.
Upvotes: 0
Views: 2711
Reputation: 2276
I Have achieved this with the below json format:
orderFields: FormlyFieldConfig[] = [
{
fieldGroupClassName: 'flex-container',
fieldGroup: [
{
className: 'mat-form-field',
type: 'input',
key: 'firstName',
templateOptions: {
label: 'First Name',
}
},
{
className: 'mat-form-field ',
type: 'input',
key: 'lastName',
templateOptions: {
label: 'Last Name',
}
},
{
className: 'mat-form-field',
type: 'input',
key: 'lastName',
templateOptions: {
label: 'Last Name',
}
}]
}
];
Here the class 'mat-form-field'
is the key to arrange the inputs side by side.
Upvotes: 3