angular ng module validation issue and Laravel auth password confirmed issue
Farhan Fairooz. The question was asked: Apr 06, 2020. 07:22
1 answer
when I create error massage on angular frontend it occurred error like this Property 'name' does not exist on type 'any[]'. even got issue in enter email and password. I created empty array for for display error massage but when I going to compile it. following bellow error will display
<div class="form-group row"> <label for="inputName3" class="col-sm-3 col-form-label" >Name</label> <div class="col-sm-8"> <input type="text" name="name" class="form-control" id="inputName3" [(ngModel)]= "form.name" required> <div class="alert alert-danger" [hidden] = "!error.name"> {{error.name}} </div> </div> </div> public error = []; public form = { email: null, name: null, password: null, password_confimation: null }; handleError(error) { this.error = error.error.errors; } onSubmit() { return this.http.post('http://localhost:8000/api/signup ', this.form).subscribe( data => console.log(data), error => this.handleError(error) ); }
Laravel issue Sign UP
if I enter correct password still it shows need to enter match password but when I remove confirmed part 'password'=> 'required'
it work fine.
**User.php** public function setPasswordAttribute($value) { $this->attributes['password'] = bcrypt($value); } **AuthController.php** public function signup(SignUpRequest $request) { $user = User::create($request->all()); return $this->login($request); } **SignUpRequest.php** public function rules() { return [ 'name'=> 'required', 'email'=> 'required|email|unique:users', 'password'=> 'required|confirmed' ]; }