如何在html中为angularjs提供.pdf文件的链接?ng-src
How to give a link to .pdf file in html for angularjs? ng-src
这是我的app.js文件中的一个Product details .
{
code:'18471IN-4-CP',
name:'Symbol Bath and Shower Trim',
price:22875.95,
description:'Symbol recessed bath and shower faucet trim with lever handle and diverter button.',
specification:'These are the new specs from json.',
canPurchase:true,
soldOut:false,
images:[
{
full:'BathTub.jpg',
thumb:'Pipe.jpg'
},
{
full:'Shower Trim1.jpg',
thumb:'Pipe1.jpg'
}
],
technicalDetail:'6311W-926.pdf',
cadDrawing: 'k_6311w_0.dwg'
},
下面的html代码根据app.js中的json var details从img文件夹加载图像
<img ng-src="img/{{product.images[0].thumb}}">
如何把链接,允许下载pdf (6311W-926.pdf这是在pdf文件夹)或任何其他文件扩展名?
像——ng-src = " pdf/{{product.technicalDetail}}"
试试这个:
<a ng-href="pdf/{{product.technicalDetail}}" target="_blank"> download pdf </a>
相关文章:
- markrwithlabel.js(第三方)原始文件链接断开
- 我想通过单击按钮将 2 个 php 文件链接在一起
- Javascript文件链接无法正常工作
- 如何将文件链接不仅存储在文件输入中,而且存储在隐藏输入中
- 如何使用Phonegap for iPad通过ShareKit共享图像文件/链接
- 在Outlook 2010中打开eml文件链接(而不是浏览器)
- jQuery未与HTML文件链接
- 使用iron路由器1.0.0-pre2版本下载文件链接
- 如何将CSS、javascript和HTML文件链接在一起
- CKEditor JS API插入内部文件链接(MediaWiki所见即所得扩展)
- 如果用户退出网页,取消文件链接
- 当使用Angular.js和.htaccess重新加载页面时,没有获得JS/CSS文件链接
- Bootstrap 3:下拉菜单不工作与.js和引导文件链接
- 除了pdf以外的所有文件链接的JS RegEx
- Javascript外部文件链接不正确
- Twitter配置文件链接或用户名配置文件图像url
- 打开文件链接与应用程序在用户点击
- Chrome文件链接大长度-标签崩溃
- 为什么不从头文件链接Javascript文件,但只有在html的结尾工作
- 如何打开html文件链接与图像和东西在mvc