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

forced reload cache $odataresource #90

Open
HASSANDL opened this issue Oct 13, 2016 · 7 comments
Open

forced reload cache $odataresource #90

HASSANDL opened this issue Oct 13, 2016 · 7 comments

Comments

@HASSANDL
Copy link

hello, very very thanks. how forced refresh get data from api?
please show an example.

@kyse
Copy link
Collaborator

kyse commented Oct 14, 2016

You'll have to be a little more detailed on what you don't understand about the refresh functionality. Or "forced refresh" for that matter. Please refer to the Refresh Section for already provided examples.

@HASSANDL
Copy link
Author

HASSANDL commented Oct 14, 2016

I want forced reload cache $odataresource.
I use this code but when once run this code and change data in sql and run again it with forcedRefresh = true but not affected data.

var out = forcedRefresh ? $odataresource(url).odata().re() : $odataresource(url).odata();
out = out.select(['ItemID', 'Name']).query();

@HASSANDL HASSANDL changed the title forced refresh odata forced reload cache $odataresource Oct 14, 2016
@kyse
Copy link
Collaborator

kyse commented Oct 15, 2016

Your code looks right to me. Have you taken a look at the unit teats for other examples?

@HASSANDL
Copy link
Author

your plugin use http cache?

@kyse
Copy link
Collaborator

kyse commented Oct 15, 2016

The persistence option is a tool to help when you want to retrieve the same data but you dont need to enter the same query criteria all over again. If your updating an entry in your db then recalling quert after the re method, the returned resource object should be populated with the new data.

@HASSANDL
Copy link
Author

please more explain or write an example.

@kyse
Copy link
Collaborator

kyse commented Oct 18, 2016

As I already suggested there is a good writeup describing the persistence/refresh options in the readme, and there are ample examples in the unit test files. If something isn't clear enough, please point out specifically what you need clarification on.

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