JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app="Test">
<div ng-controller="TestController">
<div ng-repeat="str in myData">
<input type="text" ng-model="str.string" ng-change="click()">
</div>
<br/> <span ng-if="count >= 1" style="color:red;">One or more string is empty</span>
</div>
</div>
</div>
JavaScript
var app = angular.module('Test', []);
app.controller('TestController', ['$scope', function ($scope) {
$scope.myData = [{
"id": 1,
"string": "A"
}, {
"id": 2,
"string": ""
}, {
"id": 3,
"string": "M"
}];
showVal();
$scope.click = function () {
showVal();
}
function showVal() {
$scope.count = 0;
for (var i = 0; i < $scope.myData.length; i++) {
if ($scope.myData[i].string === "") {
$scope.count++;
}
}
}
}]);