latest updates @APR 20, 2022
This commit is contained in:
parent
90b15f5e00
commit
a0bdbc7c55
1657 changed files with 301942 additions and 0 deletions
77
src/app/add/reset-password/reset-password.component.ts
Normal file
77
src/app/add/reset-password/reset-password.component.ts
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { MdDialog, MD_DIALOG_DATA, MdDialogRef } from '@angular/material';
|
||||
import { ContactService } from '../../contact.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-reset-password',
|
||||
templateUrl: './reset-password.component.html',
|
||||
styleUrls: ['./reset-password.component.scss']
|
||||
})
|
||||
export class ResetPasswordComponent implements OnInit {
|
||||
pass:any;
|
||||
cnfrmpass:any;
|
||||
iType:any = "password";
|
||||
iType_1:any="password";
|
||||
errorMsg:string;
|
||||
showError: boolean = false;
|
||||
|
||||
constructor(private contactService: ContactService,public dialog: MdDialog,public dialogRef: MdDialogRef<ResetPasswordComponent>, @Inject(MD_DIALOG_DATA) public data: any) {
|
||||
console.log(data);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
}
|
||||
error :boolean = false;
|
||||
reset(){
|
||||
|
||||
var that = this;
|
||||
let userid = this.data._id ;
|
||||
console.log("reset passowrd");
|
||||
if(this.pass != this.cnfrmpass){
|
||||
this.error = true ;
|
||||
that.errorMsg = "Password do not matched";
|
||||
let showError = setTimeout(function(){ that.error = false; clearTimeout(showError); },3000)
|
||||
}else{
|
||||
let payLoad={
|
||||
id : userid,
|
||||
pass : this.pass
|
||||
};
|
||||
this.contactService.resetPass(payLoad).subscribe(res=>{
|
||||
console.log(res);
|
||||
this.dialogRef.close('succ');
|
||||
},error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
closebox(){
|
||||
console.log("close the box");
|
||||
this.dialogRef.close('close');
|
||||
|
||||
}
|
||||
|
||||
showBtn : boolean = true;
|
||||
showBtn_1 : boolean = true;
|
||||
show_hide_pass(id){
|
||||
debugger;
|
||||
console.log(id);
|
||||
if(id == 0){
|
||||
this.iType = 'text';
|
||||
this.showBtn = !this.showBtn;
|
||||
}
|
||||
if(id == 1){
|
||||
this.iType = 'password';
|
||||
this.showBtn = !this.showBtn;
|
||||
}
|
||||
if(id == 2){
|
||||
this.iType_1 = 'text';
|
||||
this.showBtn_1 = !this.showBtn_1;
|
||||
}
|
||||
if(id == 3){
|
||||
this.iType_1 = 'password';
|
||||
this.showBtn_1 = !this.showBtn_1;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue