mat-form-field must contain a matformfieldcontrol.. component. mat-form-field must contain a matformfieldcontrol.

 
componentmat-form-field must contain a matformfieldcontrol.  mat-form-field must contain a matformfieldcontrol textarea at-form-field must contain a MatFormFieldControl

Simplified Code: <mat-radio-button> <mat-form-field> <input matInput> </mat-form-field> </mat-radio-button>Teams. If I add *ngIf to my material input, it says "mat-form-field must contain a MatFormFieldControl. 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)formControlName for mat-list gives 'mat-form-field must contain a MatFormFieldControl' 4 Angular Material: mat-form-field must contain a MatFormFieldControl when creating a custom form field controlI've tried adding ngDefaultControl but after that I receive "Error: mat-form-field must contain a MatFormFieldControl. 486 mat-form-field must contain a MatFormFieldControl. Whether the control is empty. 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. Import MatInputModule and MatFormFieldModule; Add matInput directive to the mat-form-field control. Hi Guys ,I have faced this error ERROR Error: mat-form-field must contain a MatFormFieldControl. Now, these 8 steps are coming from steps module which having 8 different step form. Error: mat-form-field must contain a MatFormFieldControl. My problem is when I attempt to use mat-input-field in the login. The form field will add a class, mat-form-field-type- { {controlType}} to its root element. 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. If 'mat-form-field' is an Angular component, then verify that it is part of this module. Angular Material form issue: angular mat-form-field must contain MatFormFieldControl 1 Getting ERROR mat-form-field must contain a MatFormFieldControlMY goal is to have the input field inside the mat-list tag or combine them somehow because right now it functions like the received data gets into the mat-list field which is shown on my page but the input fields data is sent when i press submit which is empty. The value of the attribute is irrelevant, which is why you. The text was updated successfully, but these errors were encountered:1. 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. 3. However I'm getting this, ERROR Error: mat-form-field must contain a MatFormFieldControl. Do you have any advice for me?I have a mat-form-field with a mat-select in it. 2. 1 'mat-form-field' is not a known element: 1. . Hot Network Questions Overstayed my visa in Germany by 9 daysError: mat-form-field must contain a MatFormFieldControl Vous seriez tenté de les utiliser sans mat-form-field mais vous perdriez alors les fonctionnalités built-in et la cohérence graphique. <md-form-field> <input type="text" mdInput> </md-form-field>. Angular Material: mat-form-field must contain a MatFormFieldControl when creating a custom form field control. e. how to change Angular Material UI's mat-form-field backgroud-color? 1. So in the template you have : <mat-form-field [ngClass]=" {'nameOfYourClass': expression"> </mat-form-field>. but not inside a mat-form-field :( <mat-form-f. Learn more about Teams Angular Material: mat-form-field must contain a MatFormFieldControl when creating a custom form field control 3 <mat-error> not working inside ControlValueAccessor when inheriting validations from custom formControl in parent component 1. We also provide tips on how to resolve it by double-checking code implementation, debugging, and seeking support from relevant documentation or forums. Import MatInputModule and MatFormFieldModule; Add matInput directive to. Sameh Ulhaq. We are trying to wrap material design's Components like this: field: <mat-form-field> <ng-content></ng-conten. mat-form-field must contain a matformfieldcontrol combobox mat-form-field must contain a matformfieldcontrol. I want to make a Textbox component using Angular material form controls. Error: mat-form-field must contain a MatFormFieldControl. 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. 2 mat-form-field with appearance outline doesn't work well. Provide details and share your research! But avoid. module. I am using Angular 10 and Angular Material to create some forms. Angular material form not working - mat-form-field must contain a MatFormFieldControl. 为什么mat-form-field必须包含一个MatFormFieldControl? 在使用mat-form-field时,必须将一个实现了MatFormFieldControl接口的表单控件放置在其中。。这是因为mat-form-field组件需要. It shows the input box with an underline underneath it. This is what I get: core. Hint labels . The slide-toggle behaves similarly to a checkbox, though it does not support an indeterminate state like <mat-checkbox>. mat-form-field must contain a MatFormFieldControl. Keep in mind that updateErrorState() must have minimal logic to avoid performance issues. Learn more about Teams<form [formGroup]='ResEditGroup'> <mat-form-field> <mat-label>Title</mat-label> <input formControlName='title' matInput placeholder="Title" required/> </mat-form-field> Below are the changes I have made. Cannot find control with name, first time opening mat dialog. A lot of things from mat-form-field depends on direct input child with matInput directive. I hope some of you can enlighten me in this case. Angular Material form issue: angular mat-form-field must contain MatFormFieldControl. About;. Error: mat-form-field must contain a MatFormFieldControl. 1. 1. 1. Now, in the response I receive only the answer for the first mat-select (i. An ErrorStateMatcher must implement a single method isErrorState which takes the FormControl for this matInput as well as the parent form and returns a boolean indicating whether errors should be shown. ts file. 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. For integration I am using ngx-stripe. I have in my Angular project two forms: One login-page and one register-page. Angular Material form issue: angular mat-form-field must contain MatFormFieldControl. Angular 10: ERROR Error: mat-form-field must contain a MatFormFieldControl. mat-form-field must contain a MatFormFieldControl错误的解决方法. Angular Material: mat-form-field must contain a MatFormFieldControl when creating a custom form field control. and then select the object from your choices array like so: this. 1 Answer. The <input> with MatChipInput can be placed inside or outside the chip-list element. core. Initial value of dropdown mat-select using formControlName not reflected in UI. Then you need to add an mdInput directive in your <input>. What is the expected behavior? mat-radio and mat-radio-group should work inside mat-form-field so that forms contain. Closed Copy link. Feb 28 at 10:47. if the cell is a string it will have an input field of type 'text'. Cannot see any logic why mat-checkbox is not considered a valid form-field. I have a directive ClearButtonDirective with very general selector: 'mat-form-field' - that's intentional, so that it modifies all mat-form-fields. I am currently looking deeper at some of the warnings I am getting in my Jasmine/Karma tests and. angular material select and input inside the same field. So instead, just add an errorState property to your custom component that checks the ngControl that was injected into the constructor, like this: get errorState () { return this. textbox. 0. Hot Network Questions Looking for a book where there was a drug that permanently increased intelligenceThe MatChipInput directive can be used together with a chip-list to streamline the interaction between the two components. 4 Angular ng-content not working with mat-form-field. To fix mat-form-field must contain a MatFormFieldControl error follow the below steps. 2 Why is mat-form-field not working even after importing dependencies?. Parking is currently unavailable. The Angular error "mat-form-field must contain a MatFormFieldControl" occurs for multiple reasons: Forgetting to import MatInputModule. If 'mat-form-field' is an Angular component, then verify that it is part of this module. Unfortunately, being able to use MatAutocomplete requires surrounding the input with a mat-form-field and giving the input itself a matInput-directive. 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. Angular Material form issue: angular mat-form-field must contain MatFormFieldControl. ts and in the dialog used some other modules you must add all modules for dialog to. ,Now we will bind the data to angular material checkbox. So if I replaced the mat-label with label, then it works. mat-form-field must contain a MatFormFieldControl. This will set the color of the form field underline and floating label based on the theme colors of your app. I use an injected global service to initialize the form, so before I click the button that opens the modal, the form inside the service is already initialized and if I console. Can't bind to 'formGroup' since it isn't a known native property. . Ask Question Asked 5 years, 6 months ago. ERROR Error: mat-form-field must contain a MatFormFieldControl. 9th September, 2023 — 11 min read. The problem is, the input field doesn't get show on the website but it's clickable, but the date-icon doesn't exists. , input or textarea; Check matInput spelling. Modified 5 years, 6 months ago. 1 Answer. 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 !! 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 A question and answers site for developers to share and discuss their problems and solutions. Hot Network Questions How much clothing could one cut. e. 852 views 1 year ago #mat #angular. Understanding : mat-form-field must contain a. The objective is to be able to do something like this in a form: <mat-form-field> <lookup-state placeholder="State of. It collects links to all the places you might be looking at while hunting down a tough bug. An optional name for the control type that can be used to distinguish mat-form-field elements based on their control type. Angular material form not working - mat-form-field must contain a MatFormFieldControl. Hot Network. The standard appearance is a slightly updated version of the legacy. The mat-form-field supports 4. The <mat-form-field> will add an additional class based on this type that can be used to. Can somebody help me, since now thank you all. I'm working in an new Angular 15 project with Material 15. link Error: mat-form-field must contain a MatFormFieldControl (mat-form-field 内必须有一个 MatFormFieldControl) link Error: mat-form-field must contain a MatFormFieldControl 该错误会在你没有往表单字段中添加过表单字段控件时出现。Angular 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 MatFormFieldControlI am creating a mat-form-field that is a WYSIWYG editor. I have checked my Component code and made sure FormControl exist. Native HTML5 support is inconsistent or nonexistent. The question asks how to add a custom phone number input. Error: Template parse 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. The standard appearance is a slightly updated version of the legacy. com,. If 'mat-form-field' is an Angular component and it has 'dividerColor' input, then verify that it is part of this module. <input matNativeControl> & <textarea matNativeControl> (version 7 &. mat-form-field must contain a MatFormFieldControl. Stack Overflow. 0. 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 2 Angular material 15 does not have time or datetime picker icon for selection of time or date Other components that can act as a form field control include <mat-select>, <mat-chip-list>, and any custom form field controls you've created. 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. Is this a bug or som. g. - For Drag and Drop Load 6 more related questions Show fewer related questionsThe floatLabel="never" property on the mat-form-field keeps the placeholder from floating in the . Adrian Kokot. This is my app. See the live demo. import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppRoutingModule } from '. 11. EDIT: This is the point where you'll be facing another error: ERROR Error: mat-form-field must contain a MatFormFieldControl. I've faced this issue with inputs inside form fields: There is no errors in the console. The following Angular Material components are designed to work inside a <mat-form-field>: & (version 7 & newer) (version 7 & newer) & (version 5 & 6) <mat-select> <mat-chip-list> Breaking News. fonts. Sep 29, 2020 at 15:28. I have checked my Component code and made sure FormControl exist. そんなわけで、今回はAngular Materialで Error:mat-form-field must contain a MatFormFieldControl が出た場合の対処法をご紹介しますね。. <mat-form-field> has a color property which can be set to primary, accent, or warn. Connect and share knowledge within a single location that is structured and easy to search. Other components that can act as a form field control include <mat-select>, <mat-chip-list>, and any custom form field controls you've created. 0. But it is containing it, it's just withing the ng-content projection. In other words, you can't use a MatRadioGroup inside a MatFormField the way you have. Follow edited Oct 6, 2017 at 10:35. About; Products For Teams; Stack. Angular: mat-form-field must contain a MatFormFieldControl. 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. 然而,当我们没有正确配置mat-form-field时,会出现一个错误消息:“mat-form-field must contain a MatFormFieldControl”。这个错误消息告诉我们,mat-form-field必须包含一个MatFormFieldControl控件。在下面的段落中,我们将详细说明如何解决这个问题。 解决方案1. A question and answers site for developers to share and discuss their problems and solutions. Lively Llama answered on November 10, 2020 Popularity 10/10. It shows the input box with an underline underneath it. EDIT: Please bear in mind that the example above will create a new instance of SearchModule each time, which may not be desirable. Here is the updated app. It's generally helpfully to find the smallest version of your problem that's still broken. . js:6237 message:"mat-form-field must contain a MatFormFieldControl. Uncaught Error: Template parse errors: 'mat-form-field' is not a known element. The mat-form-field supports 4 different appearance variants which can be set via the appearance input. ERROR Error: mat-form-field must contain a MatFormFieldControl. . link Form field appearance variants . 0. <mat-form-field> <mat-label>Favorite food</mat-label> <input matInput placeholder="Ex. angular; angular-material; angular-reactive-forms; angular-components; mat-list; Share. so it doesn't really help. 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. I got an error while I was trying to add Angular material mat-form-field control. Mat-form-field must contain a MatFormFieldControl. 0. That’s because our component has not implemented MatFormFieldControl. 1. 0. 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. Learn how to use the mat-form-field component to wrap and style different Angular Material components such as input, textarea, select, and more. Provide details and share your research! But avoid. Share. No milestone. Angular unexpected error: Cant bind FormControl to input. 5 custom input, No value accessor for form control with unspecified name , didn't help. Angular Material: ERROR Error: mat-form-field must contain a MatFormFieldControl. Error: No value accessor for form control with name: 'foldersList' Error: mat-form-field must contain a MatFormFieldControl. Adding and removing the disabled attribute disables and enables the button. From what I understand, it is also not possible to put the group inside a mat-form-field either. Please let me know what kinds of code do you want to check else. I don't want to show those chips inside my input field what I wanna do is when user enters anything, the chip should be created under the input field(not inside the input. ERROR Error: mat-form-field must contain a MatFormFieldControl. <mat-form-field floatLabel="always"> <mat-label>Label</mat-label> <mat-slide-toggle>Raw</mat-slide-toggle> <textarea matInput hidden. I want to make a Textbox component using Angular material form controls. {"payload":{"allShortcutsEnabled":false,"fileTree":{"src/material/form-field":{"items":[{"name":"directives","path":"src/material/form-field/directives","contentType. Sep 29, 2020 at 15:28. If I add *ngIf to my material input, it says "mat-form-field must contain a MatFormFieldControl. ngx-mat-file-input mat-form-field must contain a. <mat-form-field> <textarea matInput. 2. Here it tells me: Unknown html tag mat-form-fi. Angular Error: "mat-form-field' is not a known. First you need to import MdFormFieldModule,MdInputModule modules in your app. A question and answer site for developers to share and discuss programming issues. I've faced this issue with inputs inside form fields: There is no errors in the console. Angular unexpected error: Cant bind FormControl to input. that would leave angular with an empty mat-form-field element at run-time. Angular – mat-form-field must contain a MatFormFieldControl and already imported. . Angular material form not working - mat-form-field must contain a. When you add the disabled attribute, its presence alone initializes the button's disabled property to true so the button is disabled. Two mat-slide-toggle with reactiveForms. No branches or pull requests. The <mat-select/> or <select/> component can be used in a form-field created by adding <mat-form-field/>. I want to show the first one on the first case and the second one on the second case. And material would apply red because it is required. 2. Angular 6 Material MatFormField shows as unknown component. Everything works properly until I add a mat-form-field element to landing page. 3 <mat-error> not working inside ControlValueAccessor when inheriting validations from custom formControl in parent component. Just remove the mat-form-field element entirely. Angular Material form issue: angular mat-form-field must contain MatFormFieldControl. I want to show the first one on the first case and the second one on the second case. This will set the color of the form field underline and floating label based on the theme colors of your app. Hot Network Questions Why isn't bombing cities under any circumstance a war crime? Same applies to launching attacks from citiesI 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 Material form issue: angular mat-form-field must contain MatFormFieldControl Hot Network Questions Negative intersection number between curve and effective divisorThanks for contributing an answer to Stack Overflow! Please be sure to answer the question. 5. Asking for help, clarification, or responding to other answers. Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. The floatLabel=&quot;never&quot; property on the mat-form-field keeps the placeholder from floating in the mat-form-field must contain a MatFormFieldControl. This property allows us to specify a unique string for the type of control in form field. In Angular Material, the select component is created by adding the <mat-select/> or native <select/> components. I understood this issue. 1. Angular Material form issue: angular mat-form-field must contain MatFormFieldControl. formBuilder. As stated in Form field | Angular Material > Error: mat-form-field must contain a MatFormFieldControl. – Mrk Sef. On this page. 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. <mat-form-field> <input matInput hidden> <ng-content></ng-content> </mat-form-field>. The component HTML is: <mat-form-field> <textarea matInput . mat-form-field must contain a MatFormFieldControl. Source:. 26. <mat-form-field> <input matInput. " What is wrong? Mukesh. The legacy appearance is the default style that the mat-form-field has traditionally had. The mat-form-field has four appearance properties, these are: Legacy — this is the default style. Improve this answer. So, the current default behaviour as given in documentation examples is to display chips inside the input box. Connect and share knowledge within a single location that is structured and easy to search. mat-form-field must contain a MatFormFieldControl #11472. Here are some steps you can follow to fix the error:But I'm getting "mat-form-field must contain a MatFormFieldControl" in the console. あなたの`mat-form-field` に `<input>`または `<textarea>`要素を含む場合、`matInput` ディレクティブを追加し、`MatInputModule` をインポートしていることを確認してください。 そうでなければ、アプリケーションで`mat-form-field must contain a MatFormFieldControl` エラーが発生します。 Bug: What is the expected behavior? The MatFormField component should render properly, as I am passing an input node with the "matInput" attribute in as a ProjectableNode What is the current behavi. Milestone. Instead of mat-form-field, you can put just a div. Closed Copy link leonlovett commented Jun 17, 2018. I'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. Bug, feature request, or proposal: Please add support for mat-radio, mat-radio-group and mat-checkbox in mat-form-field. ERROR Error: mat-form-field must contain a MatFormFieldControl. controlType . Angular material form not working - mat-form-field must contain a MatFormFieldControl. 3209. js:6237 message:"mat-form-field must contain a MatFormFieldControl. 2. 3. I guess this has to do with mat-form-field not directly containing a matInput-field. How to show input fields based on mat radio button selection in angular material. In other words, it's saying that your input must be " static ", you can't have a *ngIf encapsulating it. 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. mat-form-field must contain a MatFormFieldControl. Any way around this?mat-form-field must contain a MatFormFieldControl and already imported. I try to reduce the height of my mat-input, I don't want to use ::ng-deep and would use the theme density of material angular theming. ", but I have the mat-input right behind it (also tried it before ngIf) Angular Material: ERROR Error: mat-form-field must contain a MatFormFieldControl. Development. The problem is here : <mat-form-field> <mat-checkbox formControlName="active">Active</mat-checkbox> </mat-form-field>. But it is containing it, it's just withing the ng-content projection. Actually when I used the step form like in doc. Angular material form not working - mat-form-field must contain a MatFormFieldControl. I am using a FormBuilder to generate my FormGroup. 不要在mat-form-field 控件上使用*ngIf ,而是在mat-form-field 元素上使用。 That's a very weird decision from AngularMD team - now how do I vertically align two form fields where one has mat-form-field with input inside and the other one has a checkbox but cannot use mat-form-field with its vertical layout styles. The form will still work without it. If 'mat-form-field' is an Angular component, then verify that it is part of this module. ERROR Error: mat-form-field must contain a MatFormFieldControl. Sorted by: 10. Mar 29 2022 10:56 AM. (true indicating that they should be shown, and false indicating that they should not. An Error Occurred. Follow answered Jun 20 at 5:45. ERROR Error: mat-form-field must contain a MatFormFieldControl. 0. I am currently looking deeper at some of the warnings I am getting in my Jasmine/Karma tests and when I tried adding the MatFormFieldModule and MatInputModule as follows: import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialogRef, MatDialog, MAT. Error: mat-form-field must contain a MatFormFieldControl. even i added MatFormFieldModule. You signed in with another tab or window. mat-form-field must contain a MatFormFieldControl and already imported. 0. @YSFKBDY I changed options of the second mat-select to options2. If 'mat-form-field' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the. Though it is not very clear but add formControl "mat-selection-list"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 MatFormFieldControlI am triing to create dialog with input fields using angular material mat-form-field. ts file. Improve this question. Development. 2. I tried to put the background image off but it doesn't work. component, header. form = this. edukng623 opened this issue on May 23, 2018 · 4 comments. 3. Paramjeet. Is there any WYSIWYG editor that can compatible with mat-form-field? Here is the stackblitz for your reference. schemas' of this component to. 1. " stack:"Error: mat-form-field must contain a MatFormFieldControl. 0. module), i got this error: Uncaught Error: Template parse errors: 'mat-form-field' is not a known element But other angular material 2 components work fine in the app. mat-form-field must contain a MatFormFieldControl. 0. Did you overlook to adds matInput to the native input or textarea element?" Which is the expected behavior? mat-form-field shall view that i have added matInput to the inp. Asking for help, clarification, or responding to other answers. In my HTML part of the login I use <mat-form-field></mat-form-field>. 6. 5. In this example we'll use my-tel-input as our control type which will result in the form field adding the class mat-form-field-my-tel-input. mat-form-field must contain a matformfieldcontrol unit test. We try to import angular material using. mat-form-field-underline { height: 0px !important; display: none !important; } Inspect element and get the class name and overwrite that class with you custom class, any. Bug, feature request, or proposal: Currently, I'm not sure it's a bug or it's intended: When use ng-container with mat-form-field, got this error: field must contain a MatFormFieldControl. Angular Material: mat-form-field must contain a MatFormFieldControl when creating a custom form field control. onetwo12. Standard — slightly updated version of legacy, with more spacing consistent with Fill and Outline. To resolve the “Can’t bind to ‘ngModel’ since it isn’t a known property of ‘input'” error, follow these steps: Install the FormsModule: First, ensure that you have the FormsModule installed in your Angular project. Update: Option 1 does not work for new angular versions because @ViewChild () returns undefined in ngOnInit () hook. 1313 Can't bind to 'formGroup' since it isn't a known property of 'form' 1 Angular change focus color for mat-label inside mat-form-field. MatRadioGroup looks like Material component appointed to manage radio type selectors. MatFormFieldControl is an interface that the <mat-form. . js:6272 ERROR Error: mat-form-field must contain a MatFormFieldControl. 备忘一下。. Our current implementation is a little complicated and relies on private API of Material so I would avoid extending our implementation but that's up to you 😄!. I was trying to find out the solution but failed. 2,389 5 5 gold badges 23 23 silver badges 34 34. 3 <mat-error> not working inside ControlValueAccessor when inheriting validations from custom formControl in parent component. even i added MatFormFieldModule. Solution. Angular Error: "mat-form-field' is not a known element" 5. Those elements are inside <mat-form-field> (with position absolute), that's why changing <mat-form-field> classes doesn't work. Just remove 'ngModel' from your inputs. Angular Material: mat-form-field must contain a MatFormFieldControl when creating a custom form field control. mat-form-field must contain a matformfieldcontrol checkbox. The form is inside an angular material dialog. 1. it works fine for me. Angular Material: mat-form-field must contain a MatFormFieldControl when creating a custom form field control 26 Angular: mat-form-field must contain a MatFormFieldControl I have a Angular Material search input field that is defined like this in an Angular app. As the comment above suggests, simply put readonly on the <input>. typescript. Wrapping the mat-select in a mat-form-field gives me the following error: mat-form-field must contain a MatFormFieldControl. That’s because our component has not implemented MatFormFieldControl.