I am facing a small issue. I want to display icons from categories that I receive from my REST API. To achieve this, I am using AngularJS with REST API which provides me with the designed icons. However, I encountered an error in Firebug:
"NetworkError: 404 Not Found - http://localhost:8888/app/%7B%7Bc.icon%7D%7D"
The reason for this error is that my template is loaded before receiving the API response.
<ul class="col-md-9 inner">
<li ng-repeat="c in categories"><img src="{{c.icon}}" alt="{{c.name}}" ng-cloak></li>
</ul>
This is the relevant code snippet from my controller
Category.getList().then(function(categories) {
$scope.categories = categories;
});
I have attempted to use ng-cloak and also experimented with ng-show="categories" without success. How can I prevent this behavior and ensure that ng-repeat only loads when the 'categories' variable is populated?