What you have here is a classic front end vs back end issue. You have to get everything you need from the server before you then start using it on the front end in Angular (unless you then do another ajax request to get more data).
So the solution I would suggest is that you send more information along with your icon
object.
You have this script in your page which goes off to MOCK_DATA2.json to get information. The file needs to not only include the icon.fileName but also an icon.filemtime. You could do that manually or using a server side script to add or generate it.
var iconApp = angular.module('iconApp', ['ngAnimate']);
iconApp.controller('ListController', ['$scope', '$http', function($scope, $http){
$http.get('js/MOCK_DATA2.json').success(function(data){
$scope.iconData = data;
$scope.orderProp = "name";
});
}]);
Once that's added to iconData you can then change your page's html:
<tr ng-animate="'animate'" ng-repeat="icon in filtered = (iconData | filter: query | orderBy: orderProp)">
<td><img src="images/icons/{{icon.fileName}}.png"></td>
<td>{{icon.name}}</td>
<td>{{icon.group}}</td>
<td>{{icon.description | limitTo:50:begin}}</td>
<td>{{icon.filemtime}}</td>
</tr>
PHP option
If you don't have the option of adding more information to the file then you could load it with php, json_decode()
it, loop the icons and get the filemtime for each. Add each to your data then json_encode()
and print it to the page's html in a way the javascript can see it:
var iconData = <?php print json_encode($iconData); ?>;
A little more work, and you'd then have the icon data pasted in the html of the page, but might be an easier workflow to manage.
Final option
There is one other alternative, but that would require an additional ajax request per image to attempt to get the file modified time. See here:
Is it possible with javascript to find file's last modified time?