As explained here, the angularjs directive ng-src is used to prevent the browser from loading the resource (e.g. image) before the handlebars get parsed. I\'m currently usin
I hit the same issue also. One thing I noticed is that if the value for ng-src is undefined then no img is fetched. Therefore, I created a utility method to concat two arguments and return a value if and only if both arguments are defined. See below.
myApp.factory('MyUtil', function() {
return {
strConcat: function(str1, str2) {
return (angular.isDefined(str1) && angular.isDefined(str2)) ?
(str1 + str2) : undefined;
}
}
});
function MyCtrl($scope, $timeout, MyUtil) {
$scope.MyUtil = MyUtil;
...
}
FIDDLE