const createFullName = (first, last) => {
return `${last}, ${first}`;
};
let partyImage = "";
if(party=="R") {
partyImage = "<img src='/images/r.png'>";
} else {
partyImage = "<img src='/images/d.png'>";
}
let chamberImage = "";
if(chamber == "senate") {
chamberImage = "<img src='/images/s.svg'> Senate";
} else {
chamberImage = "<img src='/images/h.png'> House";
}
$scope.users.push({
party_name: partyImage,
fullname: createFullName(first_name, last_name),
chamber_name: chamberImage,
district_name: district,
state_name: state
});
The HTML part
<tr ng-repeat="user in users">
<td>{{user.party_name}}</td>
<td>{{user.fullname}}</td>
<td>{{user.chamber_name}}</td>
<td>{{user.district_name}}</td>
<td>{{user.state_name}}</td>
</tr>
When attempting to display the images, they are shown as tags instead of displaying the actual images. The other variables in the push function are Strings and are displayed correctly. Can someone assist me with this issue?