mat form field must contain a matformfieldcontrol. Lively Llama answered on November 10, 2020 Popularity 10/10. mat form field must contain a matformfieldcontrol

 
 Lively Llama answered on November 10, 2020 Popularity 10/10mat form field must contain a matformfieldcontrol  Hot Network Questionsmat-form-field must contain a MatFormFieldControl and already imported

mat-form-field must contain a MatFormFieldControl when creating a. so it doesn't really help. Improve this question. If 'mat-form-field' is an Angular component, then. mat-form-field must contain a MatFormFieldControl. Development. The legacy appearance is the default style that the mat-form-field has traditionally had. yeah, Mat form field must contain mat input field. When you use <mat-form-field>, form-field control must be within it. 0. I imported MatFormFieldModule at my main module, but forgot to add MatInputModule to. mat-input-element { background: rgb(181, 255, 10) !important; } orCan't use angular 'mat-form-field' inside custom angular component. Did you forget to add matInput to the native input or textarea element?To implement stripe in my angular 6 material project, I am getting mat-form-field must contain a MatFormFieldControl. 0. Load 7 more related questions Show fewer related questions Sorted by: Reset to default Know someone who can answer?. Updated: Removed previous version as Optional Chaining not supported in [ (value)]. Update app. How to use <mat-form-field> <input type file , for upload a file #11732. I have imported the MatSort module from @angular/material. import { Component, OnInit } from '@angular/core'; import {FormControl} from "@angular/forms"; @Component({ selector: 'app-autocomplete-display-example', templateUrl. In this example we'll use example-tel-input as our control type which will result in the form field adding the class mat-form-field-example-tel-input . What am I doing wrong? Angular mat-form-field. 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. formBuilder. <mat-form-field> has a color property which can be set to primary, accent, or warn. Home / Codes / typescript (3) Relevance Votes Newest. Whether the control is empty. Connect and share knowledge within a single location that is structured and easy to search. ERROR Error: md-form-field must contain a MdFormFieldControl. 11. I need to click the area where my input is then it will show up. 为什么mat-form-field必须包含一个MatFormFieldControl? 在使用mat-form-field时,必须将一个实现了MatFormFieldControl接口的表单控件放置在其中。。这是因为mat-form-field组件需要. <mat-form-field> <ckeditor [editor]="descriptionEditor" [c. mat-form-field-flex{ background-color: rgb(255, 0, 0); } as well as you can use your style. 7. 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. html:33 ERROR Error: mat-form-field must contain a MatFormFieldControl. As far as i know it´s possible to create a custom form field Hint labels . ts and in the dialog used some other modules you must add all modules for dialog to. I can't do that, of course, so I thought I could extend it instead. . Development. Angular material form not working - mat-form-field must contain a MatFormFieldControl. If 'mat-form-field' is an Angular component, then verify that it is part of this module. You don't appear to be creating your controls for your form, you will need to do something like below to create the controls data and datatype. I am using angular material native select and getting error: mat-form-field must contain a matformfieldcontrol HTML : &lt;mat-form-field&gt; &lt;select matNativeControl formControlName="xyz"Solution 2: Or if you want to set the value of your select to the object and not only the id, you need to change your template to reference the whole object: <mat-option [value]="choice" *ngFor="let choice of choices">. The form is inside an angular material dialog. mat-form-field must contain a matformfieldcontrol checkbox. And when it's. Below is my code: ts file: import { Stack Overflow. exception on @merlosy solution implementation :. Hot Network Questions Repeated punctures at the valve step Convert 64-bit Gray code to integer How to calculate effect of different voltage. We recommend a specificity of at. The directive inserts. It shows the input box with an underline underneath it. 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. We recommend a specificity of at. Quill editor and AngularJS integration. About; Products For Teams; Stack Overflow Public questions & answers; Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers;. About; Products. I have a mat-form-field with a mat-select in it. edukng623 opened this issue on May 23, 2018 · 4 comments. ERROR Error: mat-form-field must contain a MatFormFieldControl. xxxxxxxxxx. Angular material form not working - mat-form-field must contain a MatFormFieldControl. 1. Can somebody help me, since now thank you all. 4. I am currently looking deeper at some of the warnings I am getting in my Jasmine/Karma tests and. – George Perid. 3. When you use <mat-form-field>, form-field control must be within it. ERROR Error: mat-form-field must contain a MatFormFieldControl. 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. I was trying to find out the solution but failed. 0. Error: mat-form-field must contain a MatFormFieldControl. BroadCastComponent. <mat-form-field> inherits its font-size from its parent element. 备忘一下。. Let me attach my codes. But it is containing it, it's just withing the ng-content projection. This will set the color of the form field underline and floating label based on the theme colors of your app. Angular Material: mat-form-field must contain a MatFormFieldControl when creating a custom form field control 0 Angular Material Elements do not react to changes 1 Answer. Closed cpratiksha opened this issue May 14, 2019 · 13 comments ClosedDuring my digital escapades, I stumbled upon a rather techy question that a few of you might have googled - "Mat form field must contain a MatFormFieldControl?" It took me back to those days in New York when I was dabbling in the digital side of magazines, always surrounded by talented web developers. そんなわけで、今回はAngular Materialで Error:mat-form-field must contain a MatFormFieldControl が出た場合の対処法をご紹介しますね。. 14 'mat-form-field' is not a known. Add Answer . Milestone. If 'mat-form-field' is an Angular component, then verify that it is part of this module. The mat-form-field has four appearance properties, these are: Legacy — this is the default style. js:6272 ERROR Error: mat-form-field must contain a MatFormFieldControl. formControlName for mat-list gives 'mat-form-field must contain a MatFormFieldControl' 0. 2. The simplest way to set the initial date for an Angular Material Datepicker is to set an initial date value when constructing the form control. Ensure that you have a corresponding model property (e. module. Please let me know what kinds of code do you want to check else. 28. Uncaught Error: Template parse errors: 'mat-form-field' is not a known element: 1. 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 want to implement Angular Material radio group in my application, I get the following error: ERROR Error: mat-form-field must contain a MatFormFieldControl. Hint labels are additional descriptive text that appears below the form field's underline. Teams. 0. mat-form-field-flex{ background-color: rgb(255, 0, 0); } as well as you can use your style. If your form field contains native input or textarea elements, you have to set the matInput directive as shown in the code sample. Mat-table Sorting Demo not Working. mat-form-field must contain a MatFormFieldControl and already imported. . 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. 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. mat-form-field must contain a MatFormFieldControl Comment . Connect and share knowledge within a single location that is structured and easy to search. This error occurs when you have not added a form field control to your form field. But it is containing it, it's just withing the ng-content projection. The standard appearance is a slightly updated version of the legacy. mat-form-field must contain a MatFormFieldControl Jay Oct 7, 2021 mat-form-field must contain a MatFormFieldControl. Learn more about TeamsGuide: “mat-form-field must contain a MatFormFieldControl” The `mat-form-field` is a fundamental component in Angular Material that allows us to create beautiful and accessible forms. e. Those elements are inside <mat-form-field> (with position absolute), that's why changing <mat-form-field> classes doesn't work. Sep 18, 2020 at 8:55. 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. mat-form-field must contain a MatFormFieldControl. Did you import the following dependencies? npm install --save @angular/material @angular/cdk npm install --save @angular/animationsこれでmat-form-field要素のクラスにremove-topを付与した中のスタイルだけ変更することができます。 影響範囲をできうる限り小さくできる寸法です。 逆にいうと、remove-topを付与したmat-form-field中のスタイルは全て変更されてしまうので注意で書いたように、「複数<input>タグが存在し、それぞれに. This is what I get: core. group ( { description: ["descriptionhere", []], data: new FormControl (this. Now that you have imported the FormsModule, you should be able to use [ (ngModel)] with input elements in your template. 112. To fix this error, you need to ensure that the mat-form-field component is properly associated with a valid form field control. 在mat-form-field 控件中添加matInput 指令。即input 或textarea 3. I use the following code for an input field to pick a single date. 1. Hot Network Questions I would like to model this shape, but can't figure out how. Angular Material is a popular UI component library that provides a variety of easy-to-use, stylish components for building modern web. I'm on angular 7. If 'mat-form-field' is an Angular component, then verify that it is part of this module. I tried the NGX Angular Material library because it's the only one which contains a file input compatible with Angular Material. Here are a few possible Here are a few possible This answer is helpful and/or accurate. Parking is currently unavailable. 1. Just remove 'ngModel' from your inputs. . 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. angular material select and input inside the same field. 1. 以下のエラーメッセージが表示されます。. Angular Material: ERROR Error: mat-form-field must contain a MatFormFieldControl. For example you have: <input matInput required placeholder="First Name" type="text" formControlName="firstName" [(ngModel. Validate a form using Angular-material. George Perid. 0. Thanks anyways!No milestone. Form field · Grid list · Icon · Input. Class MatFormFieldModule is not an Angular module. ERROR Error: md-form-field must contain a MdFormFieldControl. Plus I will probably want to change the text color, etc. 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. Closed. - For Drag and Drop. If your form field contains a native <input> or <textarea> element,. Some of them contain MatSelect dropdowns, but most of them contain input[type=text] elements with matInput attribute. 今回の環境は. Mat-form-field must contain a MatFormFieldControl. ERROR: ''mat-form-field' is not a known element. g. 2. If 'mat-form-field' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule. ah okay now i get it. here is the code of the HTML openDialog:ERROR Error: mat-form-field must contain a MatFormFieldControl. 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 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. 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. Two mat-slide-toggle with reactiveForms. In console i have an error: mat-form-field must contain a MatFormFieldControl. 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. Angular Material form issue: angular mat-form-field must contain MatFormFieldControl Hot Network Questions Strange dmesg UFW messages. This will set the color of the form field underline and floating label based on the theme colors of your app. angular; angular2-forms; angular4-forms; Share. 1. <input matNativeControl> & <textarea matNativeControl> (version 7 &. typescript. 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. module. 5 custom input, No value accessor for form control with unspecified name , didn't help. An optional name for the control type that can be used to distinguish mat-form-field elements based on their control type. The problem is, the input field doesn't get show on the website but it's clickable, but the date-icon doesn't exists. The <mat-form-field> will add an additional class based on this type that can be used to easily apply special styles to a <mat-form-field> that contains a specific type of control. com,. Now, in the response I receive only the answer for the first mat-select (i. x. mat-form-field must contain a MatFormFieldControl and already imported. So if I replaced the mat-label with label, then it works. <mat-form-field> inherits its font-size from its parent element. I have been searching for this error, but I don't find something relevant to the problem. Feb 28 at 10:47. The legacy appearance is the default style that the mat-form-field has traditionally had. The Angular error "mat-form-field must contain a MatFormFieldControl" occurs for multiple reasons: Forgetting to import MatInputModule. MatFormField is for components like MatInput, MatSelect, and others which implement the MatFormFieldControl interface. 0 beta), but the old selector was still supported in v5. – 8. <mat-form-field> <mat-label>Input</mat-label> <input matInput *ngIf="condition"/> </mat-form-field> The mat-form-field: <mat-form-field> <example-tel-input placeholder="Phone number" required></example-tel-input> <mat-icon matSuffix>phone</mat-icon> <mat-hint>Include area code</mat-hint> </mat-form-field> The component with the inputs: I had the same issue. The mat-form-field is with appearance="outline". angular; angular-material; angular-reactive-forms; angular-components; mat-list; Share. On this page. 15. I was trying to find out the solution but failed. Copy. In my case I had a mat-form-field with *ngIf and the fix was wrapping the mat-form-field in another element and allpy the *ngIf on him. Saved searches Use saved searches to filter your results more quicklyAngular Material form issue: angular mat-form-field must contain MatFormFieldControl Hot Network Questions A stranger messaged me “please put 10 dollars on my card”, followed by a card number. Follow edited. This is the html code. I want to show the first one on the first case and the second one on the second case. . <mat-form-field> has a color property which can be set to primary, accent, or warn. Angular: mat-form-field must contain a MatFormFieldControl. EDIT: Please bear in mind that the example above will create a new instance of SearchModule each time, which may not be desirable. The form details will updated to the DataService ’s employees array. The issue is that the version 16 does not change its height/size with the font-size. 4. 1. Here are some steps you can follow to fix the error:This module supports ReactiveForms but it doesn't work in a MatFormFieldControl: Error: mat-form-field must contain a MatFormFieldControl. mat-form-field . If 'mat-form-field' is an Angular component, then verify that it is part of this module. e. . – Mrk Sef. mat-form-field control input should not contain *ngIf. 1. if the cell is a string it will have an input field of type 'text'. mat-form-field control input should not contain *ngIf. 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. Share Improve this answerI have a form with some mat-form-field, it is supposed to have together with others two inputs as date picker this. How to align correctly mat form field in my forms in Angular 11 material? 163. you are right. You signed in with another tab or window. しかし、サイト内のコントロールの外観は固定であることが多いため、全てのコントロールタグに属性を付けていくのは大変であり、. <ckeditor formControlName="cdEditor" [editor]="Editor" data="<p>Hello, world!</p>"></ckeditor> Have you tried to add formControlName property to ckeditor tag? <mat-form-field> is a component used to wrap several Angular Material. mat-form-field . 0 votes. ts file but I am facing the below. Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. . Related Solutions. The first. 4 Angular ng-content not working with mat-form-field. This property allows us to specify a unique string for the type of control in form field. Hi Guys , I have faced this error ERROR Error: mat-form-field must contain a MatFormFieldControl. Angular – mat-form-field must contain a MatFormFieldControl and already imported. 2,389 5 5 gold badges 23 23 silver badges 34 34. . In building app I've got no errors: core. formBuilder. module. 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. Everything works properly until I add a mat-form-field element to landing page. for options) :. If 'mat-form-field' is an Angular component, then verify that it is part of this module. 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. The <mat-form-field> doesn't support <input type="file" /> and as far as I can see there is nothing that supports it. The component is called tag-list-component. 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. If someone knows what is happening I will be grateful. schemas' of this component to suppress this message. Mat-table Sorting Demo not Working. MatFormFieldControl 是一个接口,定义了一个表单控件应该具备的属性和方法。 表单控件可以实现这个接口来与mat-form-field组件进行交互。. If I add *ngIf to my material input, it says "mat-form-field must contain a MatFormFieldControl. overview api examples. The <mat-form-field> will add an additional class based on this type that can be used to easily apply special styles to a <mat-form-field> that contains a specific type of control. Did you forget to add mdInput to the native input or textarea element?. 0. Change your [formControl] names to "options" and "options2". /app-routing. , <input> tag, you will get mat-form-field must contain a. . 3. " so it doesn't really help. I have simple Angular Material form with a text input. I need to custom style the mat-form-field instance, in particular, remove the whitesmoke background color applied by the prebuilt theme I am using in my example. how to change Angular Material UI's mat-form-field backgroud-color? 1. you can use mat-checkbox as an option. Comment . I have the same input 2 times. mat-form-field must contain a matformfieldcontrol combobox mat-form-field must contain a matformfieldcontrol. 5. I have in my Angular project two forms: One login-page and one register-page. Share. module. <mat-form-field> <mat-label> {{column}} </mat-label> <input type="text" matInput [(ngModel)]="element. The mat-form-field must contain a MatFormFieldControl. Let’s see how to reload a child component in Angular in the next tutorial. 3. I want to use MatAutocomplete on a bootstrap-styled input. Learn more about TeamsBut I'm getting "mat-form-field must contain a MatFormFieldControl" in the console. This my demo code and stackblitz HTML <form [formGroup]="changeNotifyForm" (ngSubmit)="onSubmit()"> <mat-. 2. Copy. Angular Material: mat-form-field must contain a MatFormFieldControl when creating a custom form field control. 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. mat-form-field must contain a matformfieldcontrol checkbox. 0. Doing that will give it the same weird behavior the other stackblitz has, where it seems to only want to take one character at a time for me. Error: mat-form-field must contain a MatFormFieldControl. 2. 4. Improve this question. The problem is that when I run the code, I get the error: mat-form-field must contain a MatFormFieldControl. I guess this has to do with mat-form-field not directly containing a matInput-field. ERROR, "Error: mat-form-field must contain a MatFormFieldControl. *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)mat-form-field must contain a MatFormFieldControl. ,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. The text was updated successfully, but these errors were encountered: 👍 55 saithis, marci4, slavrov, hansregeer, ggraat,. mat-form-field must contain a matformfieldcontrol. The problem is here : <mat-form-field> <mat-checkbox formControlName="active">Active</mat-checkbox> </mat-form-field>. If you are using *ngIf on mat-form-field control i. Here is the updated app. Did you forget to add mdInput to the native input or textarea element?. typeError: Cannot assign to read only property 'tView' of object '[object Object]' in angular 9. mat-form-field must contain a MatFormFieldControl and already imported. This is the HTML code: <mat-form-field> <mat-label>Event Graphic</mat-label> <ngx-mat-file-input placeholder="Basic Input" formControlName. mat-form-field must contain a MatFormFieldControl and already imported. Sorted by: 10. ngx-mat-file-input mat-form-field must contain a. Angular: mat-form-field must contain a MatFormFieldControl. Please let me know what kinds of code do you want to check else. Angular – mat-form-field must contain a MatFormFieldControl. exception on @merlosy solution implementation :. 112. 不要在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. Angular Material: mat-form-field must contain a MatFormFieldControl when creating a custom form field control. mat-form-field must contain a MatFormFieldControl. Solution. mat-form-field must contain a MatFormFieldControl and already imported. Custom form field control Build a custom control that integrates with `<mat-form-field>`. Also, I've already checked angular2 rc. 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. Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. module. For example in this guide we'll learn how to create a custom input for inputting US telephone numbers and hook. com. 4 and Material 7. 1 Answer. length was 0 but if i query over the. This works as expected. 0. 1. If 'mat-form-field' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule. – Harleay. group({ dailyConsumption: ['', Validators. 4 and Material 7. The floatLabel=&quot;never&quot; property on the mat-form-field keeps the placeholder from floating in the 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". module. However, it is important to note that the `mat-form-field` must contain a `MatFormFieldControl` in order to function properly. 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. Hint labels are specified in one of two ways: either by using the hintLabel property of <mat-form-field>, or by adding a. The next task will be be reload the child component in the All Employees tab. mat-form-field must contain a MatFormFieldControl and already imported. " stack:"Error: mat-form-field must contain a MatFormFieldControl. . Angular 10: ERROR Error: mat-form-field must contain a MatFormFieldControl. 1313. Stack Overflow. About; Products For Teams; Stack. Favourite Share. 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. Angular Material: mat-form-field must contain a MatFormFieldControl when creating a custom form field control. Error: Cannot find control with path: 'FormArray -> FormControlName' Angular. scss file. I guess this has to do with mat-form-field not directly containing a matInput-field. My problem is the mat-form-field is not showing on my browser. mat-form-field must contain a MatFormFieldControl. Can't use angular 'mat-form-field' inside custom angular component. The component was renamed from mat-input-container to mat-form-field (I think during the v2. The component is called tag-list-component. 28. angular material select and input inside the same field. . How to remove the outline mat-form-filed border corner. Image. 2 'mat-datepicker-actions' is not a known element - best solution required. 19 Uncaught Error: Unexpected directive 'MatFormField' imported by the module 'AppModule'. mat-form-field must contain a MatFormFieldControl in type file Input field. When I try to do so, I get this error: ERROR Error: mat-form-field must contain a MatFormFieldControl. 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,. 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 – Akhil Aravind Jun 5, 2018 at 5:22 Error: mat-form-field must contain a MatFormFieldControl. Also, make sure you don't have a *ngIf on the mat-select or mat-input. at. Stack Overflow. 0. Angular material form not working - mat-form-field must contain a MatFormFieldControl. Si su `mat-form-field` contiene un ` ` o ` ` asegúrese de haber añadido la directiva `matInput` y de haber importado `MatInputModule`, de lo contrario obtendrá un. <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. 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. As stated in Form field | Angular Material > Error: mat-form-field must contain a MatFormFieldControl. I have checked my Component code and made sure FormControl exist. Error: mat-form-field must contain a MatFormFieldControl. 4 participants. How to use <mat-form-field> <input type file , for upload a file #11732.