JSFiddle - React, Tailwind, and code Playground
by javiros
HTML
<div ng-app='myApp'>
<div ng-controller="AppController">
<div ng-click="getCity(step.name)" ng-repeat="step in steps">
<p> {{step.name}}</p>
</div>
</div>
JavaScript
var myApp = angular.module('myApp', []);
myApp.controller('AppController', function ($scope) {
$scope.steps = [
{name: "ABC", status: true, city: "Boston"},
{name: "DEF", status: true, city: "New York"},
{name: "GHI", status: true, city: "LA"}
];
$scope.getCity = function(name) {
angular.forEach($scope.steps, function(v, k) {
if(v.name === name) {
alert(v.city);
}
});
}
});