Hello need help in ionic 4, i have a problem when building the app in --prod it throws an error that i have problem with the Forms.
i already injected ReactiveFormsModule in page.module.ts and page.specs.ts
but no luck
Hello need help in ionic 4, i have a problem when building the app in --prod it throws an error that i have problem with the Forms.
i already injected ReactiveFormsModule in page.module.ts and page.specs.ts
but no luck
Perhaps you could try sharing your component’s .html and .ts files?
For example:
<!-- ... -->
That’s a very small picture!
Hi rob this is the files
thanks for the repsonse
login.page.html
login
<form [formGroup]="userForm" padding-right>
<ion-item>
<ion-label position="floating">Email/Username</ion-label>
<ion-input type="text" formControlName="email" required></ion-input>
</ion-item>
<ion-item>
<ion-label position="floating">Password</ion-label>
<ion-input type="password" formControlName="password" required></ion-input>
</ion-item>
<ion-button
color="primary"
expand="block"
[disabled]="!userForm.valid"
(click)="loginForm()">Login</ion-button>
</form>
login.page.module.ts
import { Component, OnInit } from ‘@angular/core’;
import { Validators, FormBuilder, FormGroup } from ‘@angular/forms’;
@Component({
selector: ‘app-login’,
templateUrl: ‘./login.page.html’,
styleUrls: [’./login.page.scss’],
})
export class LoginPage implements OnInit {
private userForm : FormGroup;
constructor(private fb : FormBuilder) {
this.userForm = this.fb.group({
email : ['' , Validators.required],
password : ['' , Validators.required]
});
}
login.page.module.ts
import { NgModule } from ‘@angular/core’;
import { CommonModule } from ‘@angular/common’;
import { FormsModule, ReactiveFormsModule } from ‘@angular/forms’;
import { Routes, RouterModule } from ‘@angular/router’;
import { IonicModule } from ‘@ionic/angular’;
import { LoginPage } from ‘./login.page’;
const routes: Routes = [
{
path: ‘’,
component: LoginPage
}
];
@NgModule({
imports: [
CommonModule,
FormsModule,
ReactiveFormsModule,
IonicModule,
RouterModule.forChild(routes)
],
declarations: [LoginPage]
})
export class LoginPageModule {}
Try:
public userForm : FormGroup;
Thanks mate ill try, thanks for the repsonse