Advertisement
Guest User

Untitled

a guest
Jan 24th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. onProjectsFormSubmit() {
  2.     if (this.projectsForm.valid) {
  3.       this.errorEvent = false;
  4.       this.projectsService
  5.         .postProjectAdd(this.projectsForm.value)
  6.         .pipe(
  7.           takeUntil(this.destroy$)
  8.         )
  9.         .subscribe(() => {
  10.           this.translate
  11.             .get('alertify.success.projectAdd')
  12.             .pipe(
  13.               takeUntil(this.destroy$)
  14.             )
  15.             .subscribe(
  16.               translation => {
  17.                 this.alertify.success(translation);
  18.               });
  19.           this.router.navigate(['/projects/projects-list']);
  20.         },
  21.           () => { this.errorEvent = true; });
  22.     }
  23.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement