我正在製作一個配置文件頁面,出於某種原因,我無法在其上加載靜態圖像。 這是我的找到函數,它查找路徑'/uploads/profilePic/image_name.jpg'中的圖像,其中此文件夾位於我的應用程序文件夾內。 路徑存儲,但圖像不顯示無法在角度模板中加載靜態圖像文件
$scope.find = function(){
$http.get('/profile/'+$stateParams.username).success(function(user){
$scope.user = user;
$scope.user.profileImage = '/uploads/profilePic/'+user.profilePic;
console.log($scope);
}).error(function(response){
$scope.error = response.message;
});
};
我的模板
<img ng-src="{{profileImage}}" alt="temp" class="img-thumbnail"><hr>
ng-src應該是user.profileImage – harishr