Guest User

Untitled

a guest
Jul 18th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. ngOnInit() {
  2. let response = this.getBoletoService.getHashBoleto(this.profissional).subscribe(
  3. (data:any) => {
  4. if(data['sucesso'] == false){
  5. return 'Boleto será enviado por e-mail'
  6. } else {
  7. this.resposta = data
  8. }
  9. err => {
  10. this.router.navigate(['erro'])
  11. }
  12. }
  13. )
  14. if(response){
  15. this.dataloaded = true;
  16.  
  17. }
  18. }
  19.  
  20. OnSubmit(f){
  21. this.profissional.endereco = f.value
  22. if(this.resposta){
  23. this.profissional['boletoGerado'] = true
  24. this.atualizaEndereco.atualizaEndereco(this.profissional).subscribe(
  25. data => {
  26. this.router.navigate(['sucesso'])
  27. window.open(`${this.url}/${this.resposta['hash']}`)
  28. },
  29. error => {
  30. window.open(`${this.url}/${this.resposta['hash']}`)
  31. this.novoEndereco = false
  32. }
  33. );
Add Comment
Please, Sign In to add comment