hi @dancancro in my case, I used Swagger to generate an API client and that’s the only API service I have. It is generated outside of
src by a
postinstall npm entry.
Indeed the service is anyhow closer to the application state, but I don’t see them together, as the app state include other stuff that aren’t coming from API, such as calculated values, temporary stuff, cached data, user interactions, etc… I’d better keep the API service in something like
@dancancro I think the idea of a “global app state” is quite plastic. I think most of it is like a local backend, indeed, but not completely, and you probably will find people with different understandings implementing it in different ways.
I’m not very experient on Redux either, so, I’m always curious to see how other people are doing too
@johnespn there is a couple of examples over the web, this is one — https://github.com/jkuri/ng2-datepicker
Bear in mind that there’s nothing special about building a library of reusable components. It will be very similar to a standard Angular2 app. You just have to configure the
NgModule to export all components, pipes, directives and services you want to reuse and ensure its
package.json is as clean as possible to let the other project use it.
It probably won’t need either routes and entry components, as it will always be just used by another app.