Recently delving into Angular.js, I've encountered an issue. Utilizing ng-repeat for iterating through a list of news items, each with Title and Body properties, some may also contain an optional picture URL to be used as the background.
I have managed to display news item elements with picture URLs appropriately when there is a valid URL available. Sample code snippet provided below:
<li class="news-item col-md-6" ng-repeat="announcement in news.announcements | limitTo:8" ng-style="{'background-image': 'url({{announcement.Url}})'}">
The challenge lies in setting announcement.Url value to a default background picture URL when it is NULL or Undefined. Seeking guidance on how to approach this scenario.
Your assistance would be greatly valued.
Many thanks!