Mat form field must contain a matformfieldcontrol. See the test 'mat-form-field should detect errors after validations are triggered' in github. Mat form field must contain a matformfieldcontrol

 
See the test 'mat-form-field should detect errors after validations are triggered' in githubMat form field must contain a matformfieldcontrol  I want to use MatAutocomplete on a bootstrap-styled input

mat-form-field must contain a matformfieldcontrol. “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. Follow edited Oct 6, 2017 at 10:35. g. then how do i list out the international phone numbers? give me your idea please. 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. Angular Material form issue: angular mat-form-field must contain. The form will still work without it. If you are using *ngIf on mat-form-field control i. Seems like after 3 years there's still no fix to this issue in Angular Material. Copy. Just remove 'ngModel' from your inputs. how to change Angular Material UI's mat-form-field backgroud-color? 1. mat-input-element { padding: 1. Angular material form not working - mat-form-field must contain a MatFormFieldControl. 0. Th. Ask Question Asked 5 years, 6 months ago. 3. About; Products For Teams; Stack Overflow Public questions & answers; Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers;. mat-form-field' is not a known element in angular. This is the HTML code: <mat-form-field> <mat-label>Event Graphic</mat-label> <ngx-mat-file-input placeholder="Basic Input". Follow edited. Angular Material DatePicker -- Error: mat-form-field must contain a MatFormFieldControl 2 'mat-datepicker-actions' is not a known element - best solution required. for options) :. . 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. mat-form-field . somehow I see ERROR Error: mat-form-field must contain a MatFormFieldControl. mat-form-field must contain a matformfieldcontrol checkbox. Bug, feature request, or proposal: Please add support for mat-radio, mat-radio-group and mat-checkbox in mat-form-field. 1 'mat-form-field' is not a known element: 1. The first. Follow answered Jun 20 at 5:45. 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. 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. Stack Overflow. Angular Material form issue: angular mat-form-field must contain MatFormFieldControl Load 7 more related questions Show fewer related questions 0Error: 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. 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. Angular Material form issue: angular mat-form-field must contain MatFormFieldControl. 0. Closed. <mat-form-field> has a color property which can be set to primary, accent, or warn. 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. Oh I see. 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,. Learn more about TeamsWrong --> <mat-form-field> </mat-form-field> <mat-form-field> </mat-form-field> Breaking News: Grepper is joining You. Can't bind to 'formGroup' since it isn't a known native property. If I add *ngIf to my material input, it says "mat-form-field must contain a MatFormFieldControl. I'm new to Angular so any help would be appreciated. Angular Material form issue: angular mat-form-field must contain MatFormFieldControl Hot Network Questions Negative intersection number between curve and effective divisorAngular Material form issue: angular mat-form-field must contain MatFormFieldControl. Development. mat-form-field must contain a MatFormFieldControl in type file Input field. Subscribe. If 'mat-form-field' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule. 1 'mat-form-field' is not a known element: 1. 1. ts. angular; angular-material; angular-reactive-forms; angular-components; mat-list; Share. Below is my code: ts file: import { Stack Overflow. In other words, you can't use a MatRadioGroup inside a MatFormField the way you have. So you should use the new name mat-form-field. Ensure that you have a corresponding model property (e. Cannot install npm package in Angular project. This error occurs when you have not added a form field control to your form field. Angular: mat-form-field must contain a MatFormFieldControl. 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. Hint labels are specified in one of two ways: either by using the hintLabel property of <mat-form-field>, or by adding a. 0. 0. Whether the control is empty. Sameh Ulhaq. 0. mat-form-field must contain a MatFormFieldControl Comment . I have in my Angular project two forms: One login-page and one register-page. I'm on angular 7. If someone knows what is happening I will be grateful. mat-form-field must contain a MatFormFieldControl. 7. If 'mat-form-field' is an Angular component, then verify that it is part of this module. . Documentation Feedback Usecase: in my form, i need to replace textarea (inside mat-form-field) with a code editor. " What is wrong? Mukesh. This can be overridden to an explicit size using CSS. 1. Development. 4 participants. This error occurs when you have not added a form field control to your form field. ", 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. . The component HTML is: <mat-form-field> <textarea matInput . Error: mat-form-field must contain a MatFormFieldControl. Follow. javascript; angular; typescript; angular-material; angular-material-8; Share. 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. I tried in various ways to implement a wrapper for such a control, but to no avail. Angular Material form issue: angular mat-form-field must contain MatFormFieldControl. After I clicked the mat-form. Hi Guys ,I have faced this error ERROR Error: mat-form-field must contain a MatFormFieldControl. 3 <mat-error> not working inside ControlValueAccessor when inheriting validations from custom formControl in parent component. I have created a form that has inputs of text type and a mat-slider to get a numeric value // TS this. even i added MatFormFieldModule. . 4 Angular ng-content not working with mat-form-field. If 'mat-form-field' is an Angular component, then verify that it is part of this module. A lot of things from mat-form-field depends on direct input child with matInput directive. mat-form-field must contain a matformfieldcontrol combobox mat-form-field must contain a matformfieldcontrol. Follow edited Jan 16, 2022 at 9:42. In this guide, we will learn that it is possible to create custom form field controls group using Angular Material Components that can be used inside <mat-form-field>. Angular Material Reactive form radio button group not. 1. The legacy appearance is the default style that the mat-form-field has traditionally had. 0. The form field will add a class, mat-form-field-type- { {controlType}} to its root element. I found ngx-monaco-editor-v2 which integrates perfectly inside my form. It will resolve your problem. I am currently looking deeper at some of the warnings I am getting in my Jasmine/Karma tests and. Asking for help, clarification, or responding to other answers. This can be overridden to an explicit size using CSS. 28. mat-form-field must contain a MatFormFieldControl and already imported. angular; angular2-forms; angular4-forms; Share. Updated: Removed previous version as Optional Chaining not supported in [ (value)]. However, it is important to note that the `mat-form-field` must contain a `MatFormFieldControl` in order to function properly. It collects links to all the places you might be looking at while hunting down a tough bug. import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppRoutingModule } from '. ERROR, "Error: 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. Angular 10: ERROR Error: mat-form-field must contain a MatFormFieldControl. This applies to your other fields as well. 10 hours ago · I have tried implementing the mat-paginator using the bootstrap table. I was trying to find out the solution but failed. mat-form-field must contain a MatFormFieldControl. If you use the following class : ::ng-deep . . Whether the control is disabled. com,. I have integrated the material UI in my angular project using this command ng add @angular/material and I have imported the all necessary components on app. Quill editor and AngularJS integration. <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. Hot Network Questions Repeated punctures at the valve step Convert 64-bit Gray code to integer How to calculate effect of different voltage. Two mat-slide-toggle with reactiveForms. On this page. 0. mat-form-field must contain a MatFormFieldControl and already imported. Angular Material: mat-form-field must contain a MatFormFieldControl when creating a custom form field control. So I'll show you how to do it here. if you are using any 'input' tag in your code along with 'mat-form-field', make sure to include 'matInput' in the input tag. Angular Material: ERROR Error: mat-form-field must contain a MatFormFieldControl. 1. I am using Angular Material to create chips entered in the input field. required],. 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. schemas' of this component to. <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. Comment . 87 1 6. . Implementing. 2,389 5 5 gold badges 23 23 silver badges 34 34. Adrian Kokot. The following Angular Material components are designed to work inside a <mat-form-field>: 2. mat-form-field must contain a MatFormFieldControl. This is my app. It's not sufficient to just import it in the root module. <mat-form-field> inherits its font-size from its parent element. But it is containing it, it's just withing the ng-content projection. Connect and share knowledge within a single location that is structured and easy to search. Then the splash screen shows and never goes away. Angular Material: mat-form-field must contain a MatFormFieldControl when creating a custom form field control. 1 'mat-form-field' is not a known element: 1. You should have imported your material module inside your recipe module. <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. Teams. how to change Angular Material UI's mat-form-field backgroud-color? 1. <input matNativeControl> & <textarea matNativeControl> (version 7 &. Though it is not very clear but add formControl "mat-selection-list"I am triing to create dialog with input fields using angular material mat-form-field. 今回の環境は. Angular Material form issue: angular mat-form-field must contain MatFormFieldControl. 4. ts and is imported in my shared module : import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common';. 2. The problem is that when I run the code, I get the error: mat-form-field must contain a MatFormFieldControl. 1. Let’s see how to reload a child component in Angular in the next tutorial. No branches or pull requests. module. " so it doesn't really help. 0 votes. 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. Class MatFormFieldModule is not an Angular module. Connect and share knowledge within a single location that is structured and easy to search. Angular material form not working - mat-form-field must contain a MatFormFieldControl. Is this a bug or som. Bug, feature request, or proposal: Please add support for mat-radio, mat-radio-group and mat-checkbox in mat-form-field. Angular Material form issue: angular mat-form-field must contain 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 <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. module. The Angular error "mat-form-field must contain a MatFormFieldControl" occurs for multiple reasons: Forgetting to import MatInputModule. ngx-mat-file-input 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. 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. Lively Llama answered on November 10, 2020 Popularity 10/10. When I click on the form field, I can see the animation of the radio button is selected but not actually being selected. The slide-toggle behaves similarly to a checkbox, though it does not support an indeterminate state like <mat-checkbox>. 2. Custom form field control Build a custom control that integrates with `<mat-form-field>`. The form is inside an angular material dialog. Error: mat-form-field must contain a MatFormFieldControl. Some of them contain MatSelect dropdowns, but most of them contain input[type=text] elements with matInput attribute. The “Mat-Form-Field must contain a MatFormFieldControl” error in Angular can be resolved by using a compatible form control, importing the required. 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. Mat-Button Error: mat-form-field must contain a MatFormFieldControl. The form will still work without it. Everything works properly until I add a mat-form-field element to landing page. Improve this question. module. You signed out in another tab or window. 1 Angular Material form issue: angular mat-form-field must contain MatFormFieldControl. 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. Save the app and you should be able to see the form to add new employee in the first tab. How to align correctly mat form field in my forms in Angular 11 material? 163. Error: mat-form-field must contain a MatFormFieldControl. import { FormGroup, FormBuilder, FormControl } from "@angular/forms"; ngOnInit () { this. ngControl. even i added MatFormFieldModule. The component is called tag-list-component. 3. mat-form-field must contain a MatFormFieldControl and already imported. If 'mat-form-field' is an Angular component, then verify that it is part of this module. I have a Angular Material search input field that is defined like this in an Angular app. This is the template :When I try submit form and when I console. 在mat-form-field 控件中添加matInput 指令。即input 或textarea 3. 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. This will affect all the mat-input in your project. See the test 'mat-form-field should detect errors after validations are triggered' in github. mat-form-field control input should not contain *ngIf. *mat-form-field must contain a MatFormFieldControl. if the cell is a string it will have an input field of type 'text'. What is the expected behavior? mat-radio and mat-radio-group should work inside mat-form-field so that forms contain. Actually the error doesn't mean a module import problem, but that you're using the mat-form-field without a valid control. mat-form-field must contain a MatFormFieldControl and already imported. touched; } This should respect your normal Angular validators in the parent component, like this line in the formGroup:Error: No value accessor for form control with name: 'foldersList' Error: 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. Improve this answer. 0 Popularity 10/10 Helpfulness. mat-form-field must contain a MatFormFieldControl and already imported. <mat-form-field> inherits its font-size from its parent element. and then select the object from your choices array like so: this. 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. Q&A for work. mat-form-field must contain a MatFormFieldControl错误的解决方法. As the comment above suggests, simply put readonly on the <input>. – Gérôme Grignon. Angular Material: mat-form-field must contain a MatFormFieldControl when creating a custom form field control. ,Now we will bind the data to angular material checkbox. MSR Identity Toolbox: A Mat lab Toolbox for Speaker Recognition Research Version 1. The. Angular Material: mat-form-field must contain a MatFormFieldControl when creating a custom form field control. The issue was due to not importing the MatInputModule in the app. 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. # 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). 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. <mat-form-field> inherits its font-size from its parent element. length was 0 but if i query over the. mat-form-field must contain a MatFormFieldControl and already imported. 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. 2. 以下のエラーメッセージが表示されます。. George Perid. #matformfield #mat-form-fieldMustContainMatFormFieldControl#angular mat-form-field must Contain MatFormFieldControl how to fix mat-form-field must. I am trying to style some mat-form-fields from angular material. choices [1] });But focus went to the dummy text box as soon as I click the editor to write something into it. Let me attach my codes. MatRadioGroup looks like Material component appointed to manage radio type selectors. Implementing MatFormFieldControl. 4. 4. mat-form-field must contain a MatFormFieldControl. Sorted by: 10. If you are using *ngIf on mat-form-field control i. 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. 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. 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. About; Products For Teams; Stack. If you call the dialog from *. Angular 10: ERROR Error: mat-form-field must contain a MatFormFieldControl. Normally you get these errors when an import is missing in the app. If your form field contains a native or element, make sure you've added the matInput directive to it and have imported MatInputModule. Add Answer . . For integration I am using ngx-stripe. module. mat-form-field must contain a MatFormFieldControl and already imported. 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. mat-form-field-underline { display: none;} The underline is always going to be hidden but you can apply this style conditionnaly with the use of ngClass. This property allows us to specify a unique string for the type of control in form field. mat-form-field must contain a matformfieldcontrol unit test. module. Error: mat-form-field must contain a MatFormFieldControl. As far as i know it´s possible to create a custom form field Hint labels . 为什么mat-form-field必须包含一个MatFormFieldControl? 在使用mat-form-field时,必须将一个实现了MatFormFieldControl接口的表单控件放置在其中。。这是因为mat-form-field组件需要. If 'mat-form-field' is an Angular component, then verify that it is part of this module. 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. Teams. 为什么mat-form-field必须包含一个MatFormFieldControl? 在使用mat-form-field时,必须将一个实现了MatFormFieldControl接口的表单控件放置在其中。。这是因为mat-form-field组件需要. Option 2. First you need to import MdFormFieldModule,MdInputModule modules in your app. Keep in mind that updateErrorState() must have minimal logic to avoid performance issues. group ( { description: ["descriptionhere", []], data: new FormControl (this. Share. This is the html code. mat-form-field-appearance-outline . Image. Angular Material form issue: angular mat-form-field must contain MatFormFieldControl Hot Network Questions Strange dmesg UFW messages. The table is working fine but mat-paginator is not working. Make sure you haven't misspelled the directive as it is case-sensitive. Hot Network Questions Meaning of 'for' in 'read poems for grammatical correctness' Understanding ZFC Author's last name is misspelled online but. I am triing to create dialog with input fields using angular material mat-form-field. ERROR: ''mat-form-field' is not a known element. I have a directive ClearButtonDirective with very general selector: 'mat-form-field' - that's intentional, so that it modifies all mat-form-fields. Validate a form using Angular-material. what is difference between md-form-field and mat-form-field. . As others have said, most <mat-form-field> features are not specific to text fields, e. yeah, Mat form field must contain mat input field. If 'mat-form-field' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule. mat-form-field-underline { display: none;} The underline is always going to be hidden but you can apply this style conditionnaly with the use of ngClass. Cannot find control with name, first time opening mat dialog. About; Products. I want to show the first one on the first case and the second one on the second case. formBuilder. We recommend a specificity of at. 0. It is possible to create custom form field controls that can be used inside <mat-form-field>. mat-input-element { background: rgb(76, 0, 255) !important; } or::ng-deep . mat-form-field must contain a matformfieldcontrol checkbox. g. Please let me know what kinds of code do you want to check else. Where 'expression' is any. Mat-table Sorting Demo not Working. It does get selected if I click within the area of the radio button but outside of the form field. 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. Angular material form not working - mat-form-field must contain a. We'll be right back. 2. mat-form-field is not visible and known solutions dont work. mat-input-element { background: rgb(181, 255, 10) !important; } orCan't use angular 'mat-form-field' inside custom angular component. Standard — slightly updated version of legacy, with more spacing consistent with Fill and Outline. If 'mat-form-field'. mat-form-field must contain a MatFormFieldControl. To implement stripe in my angular 6 material project, I am getting mat-form-field must contain a MatFormFieldControl. 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. 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. stackblitz LINK. Provide details and share your research! But avoid. We also provide tips on how to resolve it by double-checking code implementation, debugging, and seeking support from relevant documentation or forums. – Harleay. 4. mat-form-field must contain a MatFormFieldControl Jay Oct 7, 2021 mat-form-field must contain a MatFormFieldControl. mat-form-field must contain a MatFormFieldControl and already imported. Copy. mat-form-field-outline { background-color: #f5f5f5; border-radius: 5px; } does not work anymore and I have been trying to find a way to do it but I have not been successful, on top of that the spacing seems to be messed up as well. Read the official announcement! Check it out. Error Mat-form-field must Contain MatFormFieldControl fix. mat-form-field must contain a MatFormFieldControl and already imported. 1. I had this issue. Angular material form not working - mat-form-field must contain a MatFormFieldControl. I have imported the MatSort module from @angular/material. Angular Material DatePicker -- Error: mat-form-field must contain a MatFormFieldControl 2 'mat-datepicker-actions' is not a known element - best solution required. 1. ts. Angular: mat-form-field must contain a MatFormFieldControl. BroadCastComponent. 0. I imported MatFormFieldModule at my main module, but forgot to add MatInputModule to. And so, I felt compelled to. ready event and run updateOutlineGap on the MatFormField; export the. consumptionForm = this. 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. 0. Your appmodule should import it before you import material module. <mat-form-field> <ckeditor [editor]="descriptionEditor" [c. How to use a date picker as an input in a form. Angular material form not working - mat-form-field must contain a MatFormFieldControl. Source:. 0. How to show input fields based on mat radio button selection in angular material. Later I have found out that I have missed to add the attribut. We also provide tips on how to resolve it by double-checking code implementation, debugging, and seeking support from relevant documentation or forums. If I add *ngIf to my material input, it says "mat-form-field must contain a MatFormFieldControl.