通过微信Js sdk,调用拍照接口后,拿到图片的url为“wxLocalResource://45862098790874”
我这样做:
模板:<img ng-src="my_avatar">
程序:$scope.my_avatar = “wxLocalResource://45862098790874”;
图片无法显示啊!
请教高手,如何破?
1
chairuosen 2015-07-15 11:27:19 +08:00
去仔细看ng-src文档
|
2
kofwang OP 问题有点笔误,重新修改一下:
我这样做: 模板:<img ng-src=“{{my_avatar}}”> 程序:$scope.my_avatar = “wxLocalResource://45862098790874”; 图片无法显示啊! |
3
dagger 2015-07-15 16:40:52 +08:00 1
https://docs.angularjs.org/api/ng/service/$sce#trustAsResourceUrl
$scope.my_avatar = $sce.trustAsResourceUrl('wxLocalResource://45862098790874'); |