Angular 无法使用文件URI显示图像
我使用cordova插件摄像头来显示图像,如果destinationType是DATA\u URL,则效果良好 .ts: html:Angular 无法使用文件URI显示图像,angular,ionic-framework,ionic2,Angular,Ionic Framework,Ionic2,我使用cordova插件摄像头来显示图像,如果destinationType是DATA\u URL,则效果良好 .ts: html: <button ion-button primary (click)="getPic()">get picture</button> <img src="{{Image}}" /> <p>this is image: {{Image}}</p> //Output -> content://me
<button ion-button primary (click)="getPic()">get picture</button>
<img src="{{Image}}" />
<p>this is image: {{Image}}</p> //Output -> content://media/external/images/media/1022
<p>{{success}}</p>
<p>{{err}}</p>
获取图片
这是图像:{{image}//输出->content://media/external/images/media/1022
{{success}}
{{err}}
我还将其添加到index.html中,但仍然不起作用
请尝试抱歉,是的,它使用DOMSanizer thanx suraj起作用
<button ion-button primary (click)="getPic()">get picture</button>
<img src="{{Image}}" />
<p>this is image: {{Image}}</p> //Output -> content://media/external/images/media/1022
<p>{{success}}</p>
<p>{{err}}</p>