title: Toast Notification after Submit in Angular (Success or Failed)
body: <p>I'm a beginner with Angular, so excuse me if it will be very easy for you.
  I would like to print a Toast Notification after the action 'submit' from the user, green if success (in other page), red if failed (in the page with the form).
  Currently, I save the data in a db and navigate to the view of the post, my api returns code 200.
  I thought to pass the status code of http, or a boolean variable, but i don't know how pass to another page/component. Here is what I have tried</p>
  
  <pre><code>if (this.actionType === 'Add') {
          const post: Post = {
          /....../
            data: this.form.get(this.formData).value
          /....../
          };
          this.postService.savePost(post)
            .subscribe((data) =&gt; {
              this.router.navigate(['/post', data.id]);
            });
        }
  </code></pre>
  
  <p>This is my function in Service </p>
  
  <pre><code>savePost(post): Observable&lt;Post&gt; {
      return this.http.post&lt;Post&gt;(this.myAppUrl + this.myPost, JSON.stringify(post), this.httpOptions)
        .pipe(
          retry(1),
          catchError(this.errorHandler)
        );
    }
  </code></pre>
  
  <p>Thanks so much</p>