Categories: php, angular, laravel, typescript

angular ng module validation issue and Laravel auth password confirmed issue

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

enter image description here

<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)]= "" required>             <div class="alert alert-danger" [hidden] = "!">              {{}}             </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'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'          ];     }  

All answers to this question, which has the identifier 61067406

The best answer:

Angular change public error = [];to public error = [] as any; now it work!!!

Last questions

how do i remove the switch on my home screen?
how to edit the JS date and time to update atuomatically?
How to utilize data stored in a multidimensional array
Powermockito not mocking URL constructor in URI.toURL() method
Android Bluetooth LE Scanner only scans when phone's Location is turned on in some devices
docker wordpress container can't connect to mysql container
How can I declare a number in java that is more than 64-bits? [duplicate]
Optaplanner solutionClass entityCollectionProperty should never return null error when simple JSON object passed to controller
Anylogic, get the time a pedestrain is in a queue
How do I fix this syntax issue with my .flex file?
Optimizing query in PHP
How to find the highest number of a column and print two columns of that row in R?
Ideas on “Error: Type is referenced as an interface from”?
JCIFS SmbFile.exists() and SmbFile.isDirectory() return false when it exists and I can listFiles()
PHP total order
Laravel booking system design
neural net - undefined column selected
How to indicate y axis does not start from 0 in ggplot?
Fragments in backStack
Spinner how to change the data