Test the project yourself: Test the project here!!!
export class PensamentoService {
private readonly API = "http://localhost:3000/pensamentos"
constructor(private http: HttpClient) { }
listar(): Observable<Pensamento[]> {
return this.http.get<Pensamento[]>(this.API)
}
cadastrar(pensamento: Pensamento): Observable<Pensamento> {
return this.http.post<Pensamento>(this.API, pensamento)
}
editar(pensamento: Pensamento): Observable<Pensamento> {
const url = `${this.API}/${pensamento.id}`
return this.http.put<Pensamento>(url, pensamento)
}
excluir(id: number): Observable<Pensamento> {
const url = `${this.API}/${id}`
return this.http.delete<Pensamento>(url)
}
buscarPorId(id: number): Observable<Pensamento> {
const url = `${this.API}/${id}`
return this.http.get<Pensamento>(url)
}
}
- Create a thought;
- Read the current database;
- Update / edit thoughts;
- Delete thoughts.
- Website - My GitHub
- Frontend Mentor - @lucasbailo
- Instagram - @lucassbailo
- LinkedIn - Lucas Bailo
This project was generated with Angular CLI version 14.0.0.
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The application will automatically reload if you change any of the source files.
Run ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module
.
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory.
Run ng test
to execute the unit tests via Karma.
Run ng e2e
to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
To get more help on the Angular CLI use ng help
or go check out the Angular CLI Overview and Command Reference page.