【发布时间】:2013-01-31 22:11:19
【问题描述】:
我的 angularjs 控制器中有一个类似$scope.doc_details 的范围,我想用它通过标签显示一个 pdf 文件,如下所示:
<object data="{{doc_details.file_url}}" type="application/pdf"></object>
但它没有加载到浏览器中,在我的 chrome 控制台中,我看到的只是:
Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost/%7B%7Bdoc_details.file_url%7D%7D
当我使用<span>{{doc_details.file_url}}</span> 显示它时,它会显示值。
【问题讨论】:
-
我敢打赌,在 angular 有机会用最终数据替换它之前,对象正在评估字符串。
-
有什么解决方法吗?
标签: javascript html angularjs