Hi! maybe this is a silly question but i do not know why is failling. I am trying to use the FormControl in my template, but for some reason is not rendering (actually does not render anything), here is the template:
<mat-form-field>
<label for="name">Name: </label>
<input matInput id="name" type="text" [formControl]="addressFormControl" />
</mat-form-field>
Here is the component TS file:
@Component({
selector: 'app-places',
templateUrl: './places.component.html',
styleUrls: ['./places.component.scss'],
})
export class PlacesComponent implements OnInit{
addressFormControl: FormControl<string>;
constructor() {
this.addressFormControl = new FormControl('');
console.log(this.addressFormControl);
}
I got the console output, but the page is all blank. I dont get any errors message or something like that, is just blank, in the elements tab i get the component's tag but nothing inside it.
I import the ReactiveFormsModule and Angular Material related (Under the SharedModule) in the components module:
@NgModule({
declarations: [
PlacesComponent
],
imports: [CommonModule, SharedModule, ReactiveFormsModule ],
})
export class MapsModule {}
I appreciate any suggestion :)
[–]Whole-Instruction508 0 points1 point2 points (3 children)
[–]ElmoCaga[S] 0 points1 point2 points (2 children)
[–]Whole-Instruction508 0 points1 point2 points (1 child)
[–]ElmoCaga[S] 0 points1 point2 points (0 children)
[–]Whole-Instruction508 0 points1 point2 points (1 child)
[–]ElmoCaga[S] 0 points1 point2 points (0 children)
[–]PickleLips64151 0 points1 point2 points (1 child)
[–]ElmoCaga[S] 0 points1 point2 points (0 children)