Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. onSubmit(form:NgForm) {
  2.  
  3. this.subscription = this._validation.validation({
  4. cell_no: form.value.cell_no, pass: form.value.password,
  5. username: this._common.getConnData().username, password:this._common.getConnData().password
  6. })
  7. .subscribe(res => {
  8. if(typeof res == 'string') // invalid access attempt
  9. {
  10. this.invalid_access = true;
  11. }
  12. else // login successful
  13. {
  14. console.log(res);
  15. }
  16. })
  17.  
  18. validation(data:{})
  19. {
  20. const body = JSON.stringify(data);
  21. const headers = new Headers();
  22. headers.append('Content-Type', 'application/json');
  23.  
  24. return this._http.post(this._common.getBaseUrl()+"doctor_panel_api/validation_modified/format/json",
  25. body, {headers: headers})
  26. .map(res => res.json());
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement