Hi @rapropos thanks for your attention and answare, i try some of your suggestion, but i still confuse with “All interaction with HttpClient should be done in services, not pages.” can you explain a bit ?
The more rigidly you can separate parts of your app from one another, ensuring that each piece is only exposed to the absolute minimum it needs, the easier it becomes to change things later, and the easier it is to isolate and test functionality and find bugs.
In practice, pages should not care where their data comes from or goes to. That means they should be operating only on streams of business objects: get an Observable<Foo> or Observable<Foo[]> from a service, present the information to the user, and call methods like add(newFoo: Foo) or update(newFoo: Foo). Maybe that will get something from on-device storage. Maybe there’s a running cache. Maybe it’ll read from the network. The page shouldn’t know or care, and that way it can’t inadvertently depend on things that it shouldn’t.
Look at the way the Tour of Heroes app is structured, specifically chapters 4 and 6 on services and HTTP backends. That design illustrates what I am talking about.
Thank you for the explanation, look like it will be more easier to implement it. about the code i solved the problem by using the new library http from ionic documentation (HTTP Server Plugin Documentation: Advantages for iOS and Android). Thank you in advance.