Seeking assistance with implementing an if/else statement to display different pictures based on a condition in AngularJS.
Here is an example of the controller code:
$scope.getFeatureNo = function (thisCase) {
if (thisCase.featureno == 1) {
return red_light;
}
else {
return amber_light;
}
When the condition is met (featureno equal to 1), a red light image from the same folder as the index.html file should be displayed.
Using ng-repeat in HTML to generate a table:
<md-grid-tile ng-repeat-start="thisCase in caselist">
{{getFeatureNo(thisCase)}}
</md-grid-tile>
Looking for guidance on how to use ng-src in this scenario and also providing details about the data structure:
{
"SchemeCaseID": "122^239",
"featureno": "1",
"slide": "LC",
... // Data continues
Appreciate any help provided and apologies for any language barriers.