angular-contentful
angular-contentful copied to clipboard
modifying api responses
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
@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!
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
@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!