2016年3月12日 星期六

於 angularjs 中顯示圖片

<img style="width:100%" data-ng-src="data:image/png;base64,{{object['照片']}}">

若要更換圖片且圖片來源是透過 <input id="fileinput" class="form-control" type="file" fileread="$parent['上傳照片']" /> 取得,則必須去除前面自動產生的 "data:image/png;base64," 這種字串
$scope.object['照片']=$scope.上傳照片.split(',')[1];

沒有留言:

批次檔正確處理中文

1. 確定檔案編碼為 UTF-8 2. 開頭先執行 chcp 65001