Friday 8 September 2017

foreach loop in angularjs

var mapAuditDescription = function (auditList) {
        angular.forEach(auditList, function (row) {
            var action = row.AuditAction == "Add" ? row.AuditAction + "ed" : row.AuditAction + "d";
            var tempDescription = " " + action + " " + row.AuditTarget + " " + row.EntityName + " (ID " + row.EntityId + ").";
            row.AuditDescription = row.UserName != null && row.UserName !="" ? row.UserName + " " + tempDescription : row.SourceName + " " + tempDescription;

        });
    }