SEARCH ; COMMUNITY; API ; DOCS ; INSTALL GREPPER. ts and in the dialog used some other modules you must add all modules for dialog to. scss file. Cannot install npm package in Angular project. Stack Overflow. I want to use MatAutocomplete on a bootstrap-styled input. Angular Material Reactive form radio button group not. edukng623 opened this issue on May 23, 2018 · 4 comments. com. link Form field appearance variants . I am importing all the Material Modules (MatFormFieldModule and MatInputModule etc through a core module. Only on chrome. {"payload":{"allShortcutsEnabled":false,"fileTree":{"src/material/form-field":{"items":[{"name":"directives","path":"src/material/form-field/directives","contentType. mat-form-field must contain a MatFormFieldControl #11472. 1. Angular Material form issue: angular mat-form-field must contain MatFormFieldControl. Feb 28 at 10:47. Form field · Grid list · Icon · Input. 1 'mat-form-field' is not a known element: 1. <mat-form-field> inherits its font-size from its parent element. A lot of things from mat-form-field depends on direct input child with matInput directive. ERROR: ''mat-form-field' is not a known element. What is the expected behavior? work properly. About; Products For Teams; Stack. The table is working fine but mat-paginator is not working. I have worked around it for the moment. Later I have found out that I have missed to add the attribute. – Gérôme Grignon. angular; angular2-forms; angular4-forms; Share. 1 'mat-form-field' is not a known element: 1. querySelectorAll('mat-option'). Viewed 10k times. 1. Lively Llama answered on November 10, 2020 Popularity 10/10. For the purpose of code re-use and to maintain consistent functionality across my web app, I created an input component in my app whose role is to embed a mat-input in a parent form. Angular material form not working - mat-form. No branches or pull requests. I have a small test application created from a tutorial found on the web, in which I define a SideNav drawer with 3 links, a toobar with a. group({ arrivalDate: new FormControl('',. Hi Guys , I have faced this error ERROR Error: mat-form-field must contain a MatFormFieldControl. ERROR Error: "mat-form-field must contain a MatFormFieldControl. required],. Hi, i am getting the above error " mat-form-field must contain a MatFormFieldControl" when i try to use angular material mat-formfield, after a couple of. Using mat-form-field with mat-input is not a problem, and I am fairly sure my imports are correct as well, yet I receive the following. yeah, Mat form field must contain mat input field. Angular Material DatePicker -- Error: mat-form-field must contain a MatFormFieldControl 2 'mat-datepicker-actions' is not a known element - best solution required. " stack:"Error: mat-form-field must contain a MatFormFieldControl. Implementing. Dynamically create a <mat-error> component and have it be projected into the parent <mat-form-field> component properly 0 formControlName for mat-list gives 'mat-form-field must contain a MatFormFieldControl'Answer by Leighton Shields <mat-checkbox> selector is an angular material checkbox component, it works like <input type=”checkbox”> & sugar coated with Material design styling and animations. schemas' of this component to suppress this message. ERROR Error: mat-form-field must contain a MatFormFieldControl. I'm on angular 7. It shows the input box with an underline underneath it. This is the HTML code: <mat-form-field> <mat-label>Event Graphic</mat-label> <ngx-mat-file-input placeholder="Basic Input". ts file. 1. 5. remove the whole content of your template and add the form controls one by one to help you to find out the origin of the issue. Oh I see. We'll be right back. The following Angular Material components are designed to work inside a <mat-form-field>: 2. I have been searching for this error, but I don't find something relevant to the problem. 0. Connect and share knowledge within a single location that is structured and easy to search. “mat-form-field must contain a MatFormFieldControl” Code Answer’s By Jeff Posted on March 3, 2021 In this article we will learn about some of the frequently asked TypeScript programming questions in technical like “mat-form-field must contain a MatFormFieldControl” Code Answer’s. 1. We recommend a specificity of at. However, it is important to note that the `mat-form-field` must contain a `MatFormFieldControl` in order to function properly. This is the HTML code: <mat-form-field> <mat-label>Event Graphic</mat-label> <ngx-mat-file-input placeholder="Basic Input" formControlName. Angular: mat-form-field must contain a MatFormFieldControl. stackblitz LINK. omid. ts file:Angular: mat-form-field must contain a MatFormFieldControl. Sameh Ulhaq. Connect and share knowledge within a single location that is structured and easy to search. I have in my Angular project two forms: One login-page and one register-page. mat-form-field must contain a MatFormFieldControl #12503. ts file. しかし、サイト内のコントロールの外観は固定であることが多いため、全てのコントロールタグに属性を付けていくのは大変であり、. xxxxxxxxxx. 1. mat-form-field must contain a MatFormFieldControl and already imported 4 Angular Material: mat-form-field must contain a MatFormFieldControl when creating a custom form field control Angular Material is a popular UI component library that provides a variety of easy-to-use, stylish components for building modern web. I guess this has to do with mat-form-field not directly containing a matInput-field. Q&A for work. Angular Material: ERROR Error: mat-form-field must contain a MatFormFieldControl. In my HTML part of the login I use <mat-form-field></mat-form-field>. This can be useful if you need to create a component that shares a lot of common behavior with a form field, but adds some additional logic. Q&A for work. You can, however, put a hidden text field inside the mat-form-field to satisfy the requirement and, if necessary, bind all the values together if what you want is to get the same look as the other fields. schemas' of this component to suppress this message. This is what I get: core. javascript; angular; typescript; angular-material; angular-material-8; Share. Angular Material form issue: angular mat-form-field must contain MatFormFieldControl 1 Getting ERROR mat-form-field must contain a MatFormFieldControl1 Answer. . It will resolve your problem. Error: mat-form-field must contain a MatFormFieldControl. Adrian Kokot. Lively Llama answered on November 10, 2020 Popularity 10/10. But they actually open in an overlay outside your component, so in my test fixture. exception on @merlosy solution implementation :. So you should use the new name mat-form-field. Angular Material form issue: angular mat-form-field must contain MatFormFieldControl. 3 <mat-error> not working inside ControlValueAccessor when inheriting validations from custom formControl in parent. How to align correctly mat form field in my forms in Angular 11 material? 163. Asking for help, clarification, or responding to other answers. Later I have found out that I have missed to add the attribut. I've created an editable using Angular Material, when a row is in an editable state each cell will show an input field depending on what data type is being displayed, e. Angular material form not working - mat-form-field must contain a MatFormFieldControl. <mat-form-field> <ckeditor [editor]="descriptionEditor" [c. For example, Chrome's are pretty superb from a masking standpoint, but Edge's datetime-local is a usability nightmare. 112. . Angular material form not working - mat-form-field must contain a MatFormFieldControl. Learn more about TeamsWrong --> <mat-form-field> </mat-form-field> <mat-form-field> </mat-form-field> Breaking News: Grepper is joining You. . Angular Material form issue: angular mat-form-field must contain MatFormFieldControl Hot Network Questions Getting rid of cube roots in the form of (a+b)+(a-b)mat-form-field must contain a MatFormFieldControl. group({ dailyConsumption: ['', Validators. This can be overridden to an explicit size using CSS. After I clicked the mat-form. xxxxxxxxxx. mat-form-field in Angular is invisible. - For Drag and Drop Load 6 more related questions Show fewer related questionsI'm using angular material to construct a page, i'm trying to use the mat-form-field component but the label is not working and i don't know why. required. How can I create checkboxes dynamically according to an array of values and get checkbox value using reactive forms?I'm creating a custom input component to be used in my angular material forms, but assigning a mat-label in the form field where the component is used has no effect. If 'mat-form-field' is an Angular component, then verify that it is part of this module. . Copy. " so it doesn't really help. Below is my code: ts file: import { Stack Overflow. Later I have found out that I have missed to add the attribut. js:6272 ERROR Error: mat-form-field must contain a MatFormFieldControl. Any way around this?ERROR Error: mat-form-field must contain a MatFormFieldControl. If you are using *ngIf on mat-form-field control i. . Angular 10: ERROR Error: mat-form-field must contain a MatFormFieldControl. 0. Error: mat-form-field must contain a MatFormFieldControl. mat-form-field must contain a MatFormFieldControl and already imported. mat-input-element { background: rgb(76, 0, 255) !important; } or::ng-deep . I am using Angular Material to create chips entered in the input field. Angular material form not working - mat-form-field must contain a MatFormFieldControl. The next task will be be reload the child component in the All Employees tab. It's generally helpfully to find the smallest version of your problem that's still broken. 0. Error: mat-form-field must contain a MatFormFieldControl. 0 Seyed Omid Sadjadi, Malcolm Slaney, and Larry Heck Microsoft Research, Conversational Systems Research Center (CSRC) s. ERROR: ''mat-grid-tile' is not a known element. If 'mat-form-field' is an Angular component, then verify that it is part of this module. I have checked my Component code and made sure FormControl exist. 1 Angular Material form issue: angular mat-form-field must contain MatFormFieldControl. 1. The form will still work without it. <mat-form-field> has a color property which can be set to primary, accent, or warn. just add to the app. Mat-Button Error: mat-form-field must contain a MatFormFieldControl. To ensure that your mat-form-field component functions properly and to avoid the “ror: mat-form-field must contain a matformfieldcontrol” error, it’s important to. angular; angular-material; angular-reactive-forms; angular-components; mat-list; Share. Angular Material form issue: angular mat-form-field must contain MatFormFieldControl. Angular Material: mat-form-field must contain a MatFormFieldControl when creating a custom form field control 1 Angular Material form issue: angular mat-form-field must contain MatFormFieldControl In this post, we explore the : mat-form-field must contain a matformfieldcontrol , its , and effects. I've tried. ", but I have the mat-input right behind it (also tried it before ngIf) has anyone succesfully wrapped ng-select for angular material, so it actually aligns and behaves like all the other fields? we decided against ng-select because of this and used ngx-mat-select-search instead, which is buggy and has a lot of boilerplate code. Paramjeet. e. If 'mat-form-field' is an Angular component, then verify that it is part of this module. x, mat-input-container is no longer supported. Replied on September 30, 2019. 112. Mat-table Sorting Demo not Working. mat-form-field must contain a MatFormFieldControl. Mat-Button Error:. Unable to pass styles to quill-editor component in angular. This can be overridden to an explicit size using CSS. I expect when I click the label, the input will be focused but I only can achieve this if I use label instead of mat-label. Angular 10: ERROR Error: mat-form-field must contain a MatFormFieldControl. The problem is that when I run the code, I get the error: mat-form-field must contain a MatFormFieldControl. However, I am annoyed by the fact that every time I want to use such a control, I have to redefine <mat-form-field> etc. This is my app. . In other words, you can't use a MatRadioGroup inside a MatFormField the way you have. mat-form-field must contain a MatFormFieldControl. Here are a few possible Here are a few possible This answer is helpful and/or accurate. No milestone. Where 'expression' is any. The floatLabel="never" property on the mat-form-field keeps the placeholder from floating in the . Angular Material form issue: angular mat-form-field must contain MatFormFieldControl. Sorted by: 10. It would be great if the component could be used inside a <mat-form-field> Currently if I include the editor inside the mat-form-field like this: <mat-form-field> <editor></edi. Open in StackBlitz. 0. The first step is to provide our new component as an implementation of the MatFormFieldControl. . But you also need to bind those chips to a form field. What is the expected behavior? mat-radio and mat-radio-group should work inside mat-form-field so that forms contain. ts. Angular Materialのフォームフィールドmat-form-fieldは、HTMLタグの属性でスタイルを変更できるようになっています。. ,The MatFormField component throws the mat-form-field must contain a MatFormFieldControl error,I want to be able to dyamically load a mat-form-field component and pass in the input node I want inside via the. We also provide tips on how to resolve it by double-checking code implementation, debugging, and seeking support from relevant documentation or forums. Nếu trường biểu mẫu của bạn chứa một phần tử gốc hoặc phần tử, hãy đảm bảo bạn. Angular Material: mat-form-field must contain a MatFormFieldControl when creating a custom form field control 0 Mat-Button Error: mat-form-field must contain a MatFormFieldControl I want to implement Angular Material radio group in my application, I get the following error: ERROR Error: mat-form-field must contain a MatFormFieldControl. Stuck on an issue? Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. @JoostK Thanks for your solution. To fix this error, you need to ensure that you have the proper form field control inside the mat-form-field and that you have imported the necessary modules. mat-form-field must contain a MatFormFieldControl and already imported. mat-form-field must contain a MatFormFieldControl. <mat-form-field> is a component used to wrap several Angular Material components and apply common Text field styles such as the underline, floating label, and hint messages. The elements like <input> or <textarea>, which are placed inside mat-form-field acts as form field controls. mat-form-field control input should not contain *ngIf. Now, in the response I receive only the answer for the first mat-select (i. How to show input fields based on mat radio button selection in angular material. required],. I can't do that, of course, so I thought I could extend it instead. . Link to working demo. Maintaining a parallel fork of a project that contains the. Copy. My html looks like below: <mat-label>First name <mat-form-field appearance="outline"> <input matInput type="text" [value]="field"/> </mat-form-field> </mat-label>. mat-form-field-flex{ background-color: rgb(255, 0, 0); } as well as you can use your style. Unfortunately, it appears the mentioned. , “yourModel”) defined in your component class. So I installed the library, imported it in my app module but it seems that I can't use the html tag ngx-mat-file-input. I have a child component that recieves an Input object and I should save what's written in the input field onto a property of this object. Improve this question. The form field will add a class, mat-form-field-type- { {controlType}} to its root element. It shows the input box with an underline underneath it. If you have multiple modules make sure you're importing the MatFormFieldModule in every module. module. . 28. mat-form-field must contain a MatFormFieldControl. I have tried to use the old methods from various answers here but none seem to work. here is the code of the HTML openDialog:ERROR Error: mat-form-field must contain a MatFormFieldControl. Simplified Code: <mat-radio-button> <mat-form-field> <input matInput> </mat-form-field> </mat-radio-button>Hvis din `mat-form-field` indeholder en ` ` eller ` ` element, skal du sikre dig, at du har tilføjet `matInput` -direktivet til det og har importeret `MatInputModule`, ellers vil du få `mat-form-field must contain a MatFormFieldControl` -fejl i din applikation. As I said in my response mat-form-field requires "matInput" as a direct child, because it needs to hook into MatFormFieldControl to check for input events like "focus". mat-form-field must contain a MatFormFieldControl and already imported. Here’s an example of how to use [ (ngModel)] correctly: <input [ (ngModel)]="yourModel" type="text">. <mat-form-field> inherits its font-size from its parent element. Wrong --> <mat-form-field> </mat-form-field> <mat-form-field> </mat-form-field> Breaking News: Grepper is joining You. Whether the control is disabled. Can't bind to 'formGroup' since it isn't a known native property. 1313. As stated in Form field | Angular Material > Error: mat-form-field must contain a MatFormFieldControl. Angular Material: mat-form-field must contain a MatFormFieldControl when creating a custom form field control. A <mat-form-field> can have up to two hint labels; one start-aligned (left in an LTR language, right in RTL), and one end-aligned. The directive inserts. mat-input-element { padding: 1. 14 'mat-form-field' is not a known. link Error: mat-form-field must contain a MatFormFieldControl (mat-form-field 内必须有一个 MatFormFieldControl) link Error: mat-form-field must contain a MatFormFieldControl 该错误会在你没有往表单字段中添加过表单字段控件时出现。And I have got few errors: 'mat-form-field' is not a known element: If 'mat-form-field' is an Angular component, then verify that it is part of this module. It collects links to all the places you might be looking at while hunting down a tough bug. at. File Upload in Angular catching value but not posting data. mat-form-field must contain a matformfieldcontrol checkbox. I have created a form that has inputs of text type and a mat-slider to get a numeric value // TS this. Mubeen Naeem answered on November 10, 2020 Popularity 9/10 Helpfulness 8/10. mat-form-field must contain a MatFormFieldControl. Hot Network Questions I would like to model this shape, but can't figure out how. It does get selected if I click within the area of the radio button but outside of the form field. The <mat-form-field> will add a class based on this type that can be used to easily apply special styles to a <mat-form-field> that contains a specific type. The component HTML is: <mat-form-field> <textarea matInput . 11. I need to click the area where my input is then it will show up. Hint labels are additional descriptive text that appears below the form field's underline. 1. Then the splash screen shows and never goes away. You switched accounts on another tab or window. Angular 10: ERROR Error: mat-form-field must contain a MatFormFieldControl. Then you need to add an mdInput directive in your <input>. Angular Material sidenav drawer locked when mat-form-field is used in the page. Quill editor and AngularJS integration. 1. Just copy and paste some code from the overview page . <mat-form-field> inherits its font-size from its parent element. . overview api examples. Did you forget to add mdInput to the native input or textarea element?. Development. My html looks like below: <mat-label>First name <mat-form-field appearance="outline"> <input matInput type="text" [value]="field"/> </mat-form-field> </mat-label>. 检查matInput 的拼写。 4. 2. Understanding : mat-form-field must contain a matformfieldcontrol Angular Material: mat-form-field must contain a MatFormFieldControl when creating a custom form field control 0 Mat-Button Error: mat-form-field must contain a MatFormFieldControl Some of these mat form fields are working but some are not working. patchValue ( { select: this. log() it only appear null without value. mat-form-field must contain a MatFormFieldControl. 4 and the stackblitz is not working for me :) (But I would love a material theme) And btw, if the material theme could contains the material checkbox for the multiple select, that would be awesome !! I have created a new angular form, that includes both text input and now a select box. ngx-mat-file-input mat-form-field must contain a. 2,389 5 5 gold badges 23 23 silver badges 34 34. mat-form-field must contain a matformfieldcontrol checkbox. Follow asked Aug 16, 2019 at 10:03. Follow edited Jan 16, 2022 at 9:42. Improve this answer. . Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. Sep 18, 2020 at 8:55. BroadCastComponent. I use the following code for an input field to pick a single date. 1. I have checked my Component code and made sure FormControl exist. <mat-form-field> has a color property which can be set to primary, accent, or warn. ts. 4 and the stackblitz is not working for me :) (But I would love a material theme) And btw, if the material theme could contains the material checkbox for the multiple select, that would be awesome !!I have created a new angular form, that includes both text input and now a select box. link Providing our component as a MatFormFieldControl The first step is to provide our new component as an implementation of the MatFormFieldControl interface that the. 9. Consider caching the ngModule somewhere (or even just factory in this case) but keep in mind that this instance is specific to a parent Injector, which is. schemas' of this component to suppress this message. If 'mat-form-field' is an Angular component, then verify that it is part of this module. Improve this answer. If 'mat-form-field' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule. QUESTION. you can use mat-checkbox as an option. ERROR Error: md-form-field must contain a MdFormFieldControl. <mat-chip-list> Simple form field Input Textarea Select Select link Floating label The floating label is a text label displayed on top of the form field control when the control. Actually the error doesn't mean a module import problem, but that you're using the mat-form-field without a valid control. I imported MatFormFieldModule at my main module, but forgot to add MatInputModule to. So in the template you have : <mat-form-field [ngClass]=" {'nameOfYourClass': expression"> </mat-form-field>. あなたの`mat-form-field` に `<input>`または `<textarea>`要素を含む場合、`matInput` ディレクティブを追加し、`MatInputModule` をインポートしていることを確認してください。 そうでなければ、アプリケーションで`mat-form-field must contain a MatFormFieldControl` エラーが発生します。 Update: Option 1 does not work for new angular versions because @ViewChild () returns undefined in ngOnInit () hook. Stack Overflow. Thanks anyways!No milestone. Did you forget to add matInput to the native input or textarea element? However, including an input with matInput shows both the input and the mat-select together, making it look weird. # writing # career # beginners # aiThere are at least 2 Material Components that would greatly benefit from a proper implementation, Datepicker and Input (for time and datetime). Angular Material form issue: angular mat-form-field must contain MatFormFieldControl Hot Network Questions Different way to unite a vector without losing detailAngular Material form issue: angular mat-form-field must contain MatFormFieldControl. 4 and Material 7. Do you have any advice for me?Outside <mat-form-field> things start to branch <mat-form-field> is designed to host a limited amount of controls element types as we already explained, so for type="radio" and type="range" in our example we need to setup something different. I found ngx-monaco-editor-v2 which integrates perfectly inside my form. Connect and share knowledge within a single location that is structured and easy to search. The Angular error "mat-form-field must contain a MatFormFieldControl" occurs for multiple reasons: Forgetting to import MatInputModule. mat-form-field must contain a matformfieldcontrol. 1 Angular Material form issue: angular mat-form-field must contain MatFormFieldControl. Hot Network Questions Why is CO2 so low in the atmosphere? Lilypond attaching postscript to a NoteHead why are wind turbines. 0. Angular Material: mat-form-field must contain a MatFormFieldControl when creating a custom form field control. Did you forget to add matInput to the native input or textarea element?" What is the expected behavior? mat-form-field shall see that i have added matInput to the input field. 852 views 1 year ago #mat #angular. if there is any *ngIf present in child tag of 'mat-form-field', specify the *ngIf condition in 'mat-form-field' tag Sorted by: 77. Parking is currently unavailable. When I click on the form field, I can see the animation of the radio button is selected but not actually being selected. Learn more about TeamsAngular Material form issue: angular mat-form-field must contain MatFormFieldControl Hot Network Questions Why don't guitar chords and staff notations match each other?mat-form-field must contain a MatFormFieldControl. Hot Network Questions Solving a limit by the. 9th September, 2023 — 11 min read. EDIT: Please bear in mind that the example above will create a new instance of SearchModule each time, which may not be desirable. even i added MatFormFieldModule. mat-form-field must contain a MatFormFieldControl. The component was renamed from mat-input-container to mat-form-field (I think during the v2. mat-form-field must contain a MatFormFieldControl and already imported. Can somebody help me, since now thank you all. I had this issue. As others have said, most <mat-form-field> features are not specific to text fields, e. mat-form-field must contain a MatFormFieldControl. I want to show the first one on the first case and the second one on the second case. The mat-form-field supports 4 different appearance variants which can be set via the appearance input. But when you unchecked the I accept the date and check again the form is invalid because with uncheck the form holds the above field which contains required and the form is invalid if optDate does not have value. Teams. If you call the dialog from *. MatFormField is for components like MatInput, MatSelect, and others which implement the MatFormFieldControl interface. Angular Material DatePicker -- Error: mat-form-field must contain a MatFormFieldControl 2 'mat-datepicker-actions' is not a known element - best solution required. ngControl. 0. But it is containing it, it's just withing the ng-content projection. nativeElement. mat-form-field must contain a. fonts. I'm not sure if for my case I should use FormControl or NgModel. MatFormFieldControl is an interface that the <mat-form-field> knows how to work with. 0 Popularity 10/10 Helpfulness. The standard appearance is a slightly updated version of the legacy. mat-form-field must contain a MatFormFieldControl and already imported. Elevation helpers Enhance your components with elevation and depth. so the answer is: if we want to use our custom wrappe, we need to create a custom form-field-control for it, in our case we need to create custom mat-form-field-control //our custom form field control<mat-form-field> has a color property which can be set to primary, accent, or warn. com. Implementing MatFormFieldControl. mat-form-field must contain a MatFormFieldControl and already imported. even i added MatFormFieldModule. Good afternoon! These days i've been working on to a pokemon-based project which consists in getting a random attack (1 of 4 strings) just by choosing in two selects (the trainer and the pokemon one). This works as expected. Angular material form not working - mat-form-field must contain a MatFormFieldControl 1 Angular Material form issue: angular mat-form-field must contain MatFormFieldControl mat-form-field must contain a MatFormFieldControl. mat-form-field must contain a MatFormFieldControl when creating a. Angular Material form issue: angular mat-form-field must contain MatFormFieldControl Load 6 more related questions Show fewer related questions 0mat-form-field must contain a matformfieldcontrol checkbox. That doesn't seem to be on the overview page. 1. Do not wrap the buttons with mat-form-field. Hot Network Questions What are FAA rules regarding FBO operations encouraging food/ refreshments for pilots?The Select component is used to enable a user to select single or multiple options available in the options drop-down. But I'm getting "mat-form-field must contain a MatFormFieldControl" in the console. You signed in with another tab or window. 0 Popularity 10/10 Helpfulness. Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. Learn more about TeamsAngular Material: mat-form-field must contain a MatFormFieldControl when creating a custom form field control 3 Angular Material DatePicker -- Error: mat-form-field must contain a MatFormFieldControlProperties. This property allows us to specify a unique string for the type of control in form field. Error: Cannot find control with path: 'FormArray -> FormControlName' Angular. 1. 在mat-form-field 控件中添加matInput 指令。即input 或textarea 3. " What is wrong? Mukesh. When you use <mat-form-field>, form-field control must be within it. The following Angular Material components are designed to work inside a <mat-form-field>: <input matNativeControl> & <textarea matNativeControl> (version 7 & newer) <select matNativeControl> (version 7 & newer) <input matInput> & <textarea. mat-form-field must contain a MatFormFieldControl in type file Input field. In this document, "form field" refers to the wrapper component <mat-form-field> and "form field control" refers to the component that the <mat-form. How can I set mat-form-field to readonly in Angular for an edit/read view, so that users can still easily read it, but not edit it? angular; angular-material;. In previous versions of angular material I could reduce the height by reducing the font-size and by reducing some specific margins and paddings inside the form-field.