Try catch block
This commit is contained in:
+5
@@ -33,6 +33,7 @@ export class ForgotPasswordComponent {
|
|||||||
const headers = new HttpHeaders({
|
const headers = new HttpHeaders({
|
||||||
'Content-Type': 'application/x-www-form-urlencoded'
|
'Content-Type': 'application/x-www-form-urlencoded'
|
||||||
});
|
});
|
||||||
|
try{
|
||||||
this.http.post<string>( "https://mistox.com/api/account/sendresetpassword", body, { headers } ).subscribe({
|
this.http.post<string>( "https://mistox.com/api/account/sendresetpassword", body, { headers } ).subscribe({
|
||||||
next: (data) => {
|
next: (data) => {
|
||||||
if (data.trim() == "Success"){
|
if (data.trim() == "Success"){
|
||||||
@@ -46,5 +47,9 @@ export class ForgotPasswordComponent {
|
|||||||
console.log("HTTP Error Signing In: ", err);
|
console.log("HTTP Error Signing In: ", err);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}catch(err){
|
||||||
|
this.errorMsgs.push("http error: " + err);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -9,7 +9,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="frame-item">
|
<div class="frame-item">
|
||||||
<input type="password" [(ngModel)]="PassworR" name="Password" placeholder=" " />
|
<input type="password" [(ngModel)]="PassworR" name="PassworR" placeholder=" " />
|
||||||
<label>Repeat New Password</label>
|
<label>Repeat New Password</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user