Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] How would I make new requests to the service? #11

Closed
julianonunes opened this issue Jun 19, 2017 · 1 comment
Closed

[Question] How would I make new requests to the service? #11

julianonunes opened this issue Jun 19, 2017 · 1 comment

Comments

@julianonunes
Copy link

julianonunes commented Jun 19, 2017

Hi Dan,

If I need to make new requests to this.dataService.getCustomersSummary() as the user types a value to filter in a Textbox, do I need to execute the same expression again or will it be different?

this.dataService.getCustomersSummary()
            .subscribe((data: ICustomer[]) => this.customers = data);

https://github.com/DanWahlin/Angular-RESTfulService/blob/master/app/customers/customers.component.ts

@DanWahlin
Copy link
Owner

Sorry for the delay. I didn't get a notification for this for some reason so I'm just now seeing it. Because Http calls subscribe and then unsubscribe once the response comes back you'll need to call the function that executes the code you mention above again if you want new data. You'd have to make a new one of course that accepts the filter data if you plan on server-side filtering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants