Skip to content

Commit

Permalink
Add service to grab notes from server #17
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaHamann committed Apr 7, 2020
1 parent d6416e8 commit 290cdb6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions client/src/app/notes/note-card.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,16 @@ export class NoteCardComponent implements OnInit, OnDestroy {

constructor(private route: ActivatedRoute, private noteService: NoteService) { }

getNotesFromServer(): void {
this.getNotesSub = this.noteService.getNotes({ owner_id: this.id })
.subscribe(notes =>
this.serverFilteredNotes = notes.reverse()
, err => {
console.log(err);
});
}
ngOnInit(): void {
this.getNotesFromServer();
}

ngOnDestroy(): void {
Expand Down

0 comments on commit 290cdb6

Please sign in to comment.