Comments (8)
Hi @fredrik-sogaard — Currently only literal strings are supported, not expressions.
You can use the contentful.entry(id)
method to fetch a single entry if you need to do so programmatically.
Please let me know if you feel expressions are needed in the directive.
I am considering adding expression support but since that is a breaking feature, I will have to release a v2.0.0 for that.
Thanks for your feedback!
from angular-contentful.
Hi @fredrik-sogaard — I have just released v2.0.0 with support for expressions in the development branch: https://github.com/jvandemo/angular-contentful/tree/development
In v2.0.0 you can use expressions by default:
<div contentful-entry="eventId">{{ $contentfulEntry | json }}</div>
and use literals if you want to specify a string:
<div contentful-entry="'some-literal-id'">{{ $contentfulEntry | json }}</div>
Can you try it out and let me know if it works for you?
Thanks!
from angular-contentful.
Thanks! That was fast!
One thing I found: I can't access the file url of a linked asset from an entry? I only have access to the "sys" fields.
from angular-contentful.
Hi @fredrik-sogaard,
That is the default behavior of Contentful (see https://www.contentful.com/developers/documentation/content-delivery-api/#search-link).
You can specify the levels of resolved content like this:
<pre contentful-entry="'sys.id=6KntaYXaHSyIw8M6eo26OK&include=3'">
{{ $contentfulEntry | json }}
</pre>
Can you try and verify if this works for you? Thanks!
from angular-contentful.
Thanks a lot for your replies. Really appreciate it!
Angular-contenful normally auto resolves links, so I thought perhaps it would also do it in this case. Because if I just get all the contentful entries, I can get the image url directly.
Den 17. jun. 2015 kl. 08.33 skrev Jurgen Van de Moere [email protected]:
Hi @fredrik-sogaard,
That is the default behavior of Contentful (see https://www.contentful.com/developers/documentation/content-delivery-api/#search-link).
You can specify the levels of resolved content like this:
{{ $contentfulEntry | json }}Can you try and verify if this works for you? Thanks!
—
Reply to this email directly or view it on GitHub.
from angular-contentful.
@fredrik-sogaard — Correct, when querying for multiple entries, this happens automatically. That is how the Contentful API works.
I have added documentation to the README to hopefully avoid confusion for others if they are in a similar situation.
Thanks for your feedback. I will close this issue but if you feel you have additional feedback, please don't hesitate to add it here. Thanks!
from angular-contentful.
Hi @jvandemo,
I have one small problem with this. Let me try to explain:
I set the eventID in the controller like this: $scope.eventId = $stateParams.eventId + '&include=1';
Which in turn I can log out and get 4DSqMNTzeMKGSgi6ckGQ60&include=1
as I would expect and everything seems to work.
But if I look in my network tab in web inspector I see this request: https://cdn.contentful.com/spaces/osmot86btiv3/entries?access_token=xxxxxxxxxxxxxxxxxxxxxxxxxxx&include=1
(access token redacted here)
This results in that every item in my list of events gets the same data.
If I remove &include=1
from the controller I get this (correct) request: https://cdn.contentful.com/spaces/osmot86btiv3/entries/4DSqMNTzeMKGSgi6ckGQ60?access_token=xxxxxxxxxxxxxxxxxxxxxxxx
Any idea of what's going on here?
from angular-contentful.
What does your template look like @fredrik-sogaard? Thanks!
from angular-contentful.
Related Issues (20)
- contentful.contentType(id) bypassing arguments HOT 3
- Allow access to $contentfulEntries.includes HOT 10
- Readme images
- pull in content from more than one space HOT 5
- Incorrect 'orderBy' syntax HOT 1
- NPM? HOT 2
- Contentful Preview API HOT 3
- Retrieving an image as a directive HOT 5
- modifying api responses HOT 3
- Connecting to multiple spaces HOT 2
- Using angular-contentful in Angular 2.0 HOT 1
- Example for searching array field with in operator HOT 1
- How can I sort the contentful response on the frontend? HOT 3
- Multiple spaces: requests are missing the host HOT 1
- Any plans to integrate the content management api as well? HOT 4
- filter don't work HOT 2
- Example only shows garbage HOT 17
- Query entries get response Bad Request HOT 3
- Asset not resolved when getting entry by id HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-contentful.