title: How to nagivate to created item in Angular
body: <p>I'm adding a new Recipe. After that i want to navigate to new added recipe.</p>
  
  <p>How should i pass created recipe's id?</p>
  
  <p>I've tried:
   this.router.navigate(['/recipe/edit/' + id]);</p>
  
  <p>but it doesn't navigate me there. 
  In response i got :
   <a href="http://localhost:5000/api/recipes/%7Bid%7D" rel="nofollow noreferrer">http://localhost:5000/api/recipes/%7Bid%7D</a> 400 (Bad Request)</p>
  
  <p><a href="https://i.stack.imgur.com/WOT5I.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WOT5I.png" alt="enter image description here"></a></p>
  
  <pre><code>this.router.navigate(['/recipe/edit/HERE MUST BE ID CREATED RECIPE']);
  </code></pre>
  
  <p>My add-recipe.component.ts</p>
  
  <pre><code>@Component({
        selector: 'app-add-recipe',
        templateUrl: './add-recipe.component.html',
        styleUrls: ['./add-recipe.component.css']
      })
      export class AddRecipeComponent implements OnInit {
        categories: Category[];
        user: User;
        recipe: Recipe;
        addRecipeForm: FormGroup;
        constructor(private fb: FormBuilder,
                    private alertifyService: AlertifyService,
                    private router: Router,
                    private recipeService: RecipeService, private authService: AuthService) { }
  
    ngOnInit() {
      this.createRecipeForm();
      this.getCategories();
    }
  
  
    createRecipeForm() {
      this.addRecipeForm = this.fb.group({
        name: ['', Validators.required],
        ingredients: ['', Validators.required],
        preparationTime: ['', Validators.required],
        description: ['', Validators.required],
        categoryId: ['', Validators.required]
      });
    }
  
  
    createRecipe(id: number) {
      if (this.addRecipeForm.valid) {
        this.recipe = Object.assign({}, this.addRecipeForm.value);
        this.recipeService.addNewRecipe(this.authService.currentUser.id, this.recipe).subscribe(() =&gt; {
          this.alertifyService.success('New recipe has been added!');
        }, error =&gt; {
          this.alertifyService.error(error);
        }, () =&gt; {
            this.router.navigate(['/recipe/edit/']);
          });
      }
    }
  
    cancel() {
      this.router.navigate(['members']);
      this.alertifyService.warning('Cancelled');
    }
  </code></pre>