6. GET por ID con routing

6.3. Servicio: añadir getById

Añadimos en src/app/services/posts.ts

getById(id: number) {
  return this.http.get<Post>(`${this.url}/${id}`);
}

https://jsonplaceholder.typicode.com/posts/6