I am following this part of the loopback4 examples:
I am not editing anything from their original example todolist app. I use lb4 example todo to clone the application then I begin following their instructions.
In step 5, it states to add
// add a new function getTodos to get the todo list from the service getTodos(): void { this.todoService.findTodos().subscribe(todos => (this.todos = todos)); }
to the export class so it can fetch from the todo list from the service.
Problem is findTodos() is not defined by the service anywhere. The tutorial does not mention anything about constructing it or having to set it up.
As a newbie, I really am unsure how I would go about doing this. On another tutorial that follows these steps exactly the same
the Service defines findTodos(). It seems like open-api was supposed to auto generate this service then? However it looks like mine were created generic.
Instead of findTodos(), I just have find(), or instead of createTodos(), its just create() in my controller.services.
I cannot figure out what I missed up, I have done this 3 times now following step by step both of these tutorials and the findTodos() service is never auto generated for me.
You can see in the 2nd tutorial, the github shows their service having defined findTodos(). I do not want to just copy and paste it since I think I am a different version ahead of this tutorial now but I also want to learn why, since this is supposed to be a learning experience.