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

modifying api responses #20

Open
p3sn opened this issue Oct 19, 2016 · 3 comments
Open

modifying api responses #20

p3sn opened this issue Oct 19, 2016 · 3 comments

Comments

@p3sn
Copy link

p3sn commented Oct 19, 2016

Hi,

I'm quite new to contentful and the angular-contentful-module but it looks very good and I love your project. It helped me a lot. I just got notified about new options to modify the api responses in this article: https://www.contentful.com/r/knowledgebase/modifying-api-responses/

It looks like that option would help me a lot to downsize the response.data to only the fields I need. Is this modyifing also posisble in the angular-contentful-module?

Regards, Peter

@jvandemo
Copy link
Owner

@p3sn — Great question! Have you already tried this?

<pre contentful-entry="'sys.id=6KntaYXaHSyIw8M6eo26OK&select=fields.productName,fields.price'">
  {{ $contentfulEntry | json }}
</pre>

Can you let us know how it goes? Thanks!

@p3sn
Copy link
Author

p3sn commented Feb 3, 2017

Hi jvandemo, thanks for your reply and sorry for my late reply. This works great, I can narrow the request down to only the fields I need.

I have another related question to optimize requests... Let's say I have created multiple 'pages' in contentful and total amount of data is getting large. Would you still load all entries in the app.controller and then select only the data you need per page? Or would you load only the data you need in the controller ?

Thanks, Regards, Peter

@jvandemo
Copy link
Owner

jvandemo commented Feb 4, 2017

@p3sn — Awesome, great to hear it worked. Can you give more details about your new question? Do you mean your "pages" are content entries in Contentful? And do you filter some pages? Or fields from the pages? Thanks!

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