Answer the question
In order to leave comments, you need to log in
How to design this?
there is a REST API
there is a service let's call it InfoService which makes REST requests and receives callbacks the
controller looks something like this
funtction controller()
{
scope.list = InfoService.getItems();
scope.remove(id) {
InfoService.remove(id);
}
}
Answer the question
In order to leave comments, you need to log in
promises. They even exist natively in the latest versions of top browsers.
Do you need a framework for such tasks?
I just thought of making the service and controller the usual js objects
, plus using some simple templating engine
I haven't worked with Angular for a long time. But you can connect with redax. Make requests through exios, it returns promises. You put it in a store, and the store is already tied to the component.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question