(function () { "use strict"; angular .module("app.utils") .service("appUtils.imageService", imageService); /** * Declare image Service to obtain and render images inside current application. * @param {"constant.patientConstants"} patientConstants */ function imageService(appSettings) { /** * Try to get user avatar and return appropriate image or default image from the storage. * @param img * @returns {*} */ this.getAvatar = function (img) { return Boolean(img) == true && img.toString().trim().length > 0 ? img : appSettings.DEFAULT_AVATAR; }; } // IoC container. imageService.$inject = [ "app.SETTINGS" ]; })();