Two fundamental inquiries:
1) Within my controller, I have defined a list with key-value pairs and I am trying to access the event name based on the eventID in order to log it in the console.
$scope.events = [
{eventID:3200, eventName:"Event One"},
{eventID:3201, eventName:"Event Two"}
];
I attempted the following code:
if($scope.events.eventID == 3200) {
console.log("Ok");
}
However, it did not work as expected.
2) In my view, there is a table displaying data retrieved from a web service. My goal is to display the description in the table based on the eventID from the $scope.events list. There is a field called event within my ng-repeat that can be used for comparison, but I am unsure how to achieve this.
<tr ng repeat d in data>
<td>d.Description</td>
<td>d.anyValue</td>
</tr>
Any assistance would be greatly appreciated. I am new to Angular and in need of guidance :)