Got some problem that I'm solving now using filters, but I'm sure there must be a clever and simpler way.
Got this view:
<ul id="FilesView" class="FilesView">
<li ng-repeat="object in folder.content.object" class="{{object.type}}">
<img src="object.thumbnails.list | thumbPrinter">
{{object.name}}
</li>
</ul>
And a filter
angular.module('appFilters', []).filter('thumbPrinter', function() {
if (media.type === 'file') {
media.src
}else{
'/images/folder.jpg'
}
});
And XML
<object>
<type>folder</type>
<name>Photos</name>
<complete_path>/Photos</complete_path>
<complete_path_hash>00e474bd8bd7deaff259</complete_path_hash>
<date_created>2013-03-06 16:33:28</date_created>
<date_updated>2013-03-06 16:33:28</date_updated>
<deleted>false</deleted>
</object>
Now this is working. but it is ugly, and has its problems.
Problems like- Lets say that I wish to print img tag, only if I got an img src, and span with folder as bg img. In currect senario I just can't.
How can I inject HTML as I wish, and not only strings? What is the correct way of doing that?
Thank you.