In my application, I am utilizing two scope variables: $scope.banner
and $scope.defaultBanner
.
The banner is fetched using a service, but in cases where the banner file does not exist, the variable will be empty as the service returns nothing.
My goal is to display the defaultBanner
if $scope.banner
is undefined. However, the priority is always to show the banner from the service if available.
Is there a way to achieve this?
UPDATE
I am specifically looking for an angular solution or any technique that can be implemented directly within the HTML view.