Here is the Angular 1.0 code that I am currently struggling with:
<div ng-repeat="ebook in vml.ebooks">
<img data-ng-src="{{ ebook.files.filter(function (v) { return v.type === 'ebook.cover'; })[0].url }}" />
</div>
Unfortunately, I am encountering the following error:
"Error: [$parse:syntax] Syntax Error: Token 'ebook' is an unexpected token at column 55 of the expression ['ebook.files.filter(function (v) { return v.type === 'ebook.cover'; })[0].url'] starting at [ebook.cover'; })[0].url'].
Could someone please help me troubleshoot this issue?
I am wondering if it would be feasible to convert this code snippet into a filter?
Essentially, I am trying to retrieve the first object with a specific type from a list of objects (files).