【问题标题】:Angular.js Click on link to download is causing navigate to home pageAngular.js 点击链接下载导致导航到主页
【发布时间】:2013-08-07 21:58:28
【问题描述】:

这就是我所拥有的

<div quick-list>
    <br quick-link icon='download-alt' href='{{ getDownloadLink(assignment) }}' text="getMessage('assignmentListStudent.attachment.action.download')">
</div>

相关函数如下

$scope.getDownloadLink = function(assignment) {

    if (!assignment || !assignment.userAttachment || !assignment.userAttachment[0] ) {
        return '';
    }

    return assignment.userAttachment[0].path.replace("equella/items", "equella/force-download/items");
};

我不确定这里出了什么问题,但是当我单击下载链接时,我看到该页面导航到主页,因为它应该下载现有文件。 这是我在 chrome 中看到的。

 <li class="quick-link ng-scope" quick-link="" icon="download-alt" href="/community/proxy/equella/force-download/items/71c1f5d5-8a1f-4e85-84d6-7560a9e01b63/1/hanks.tomha.24066.PNG" text="getMessage('assignmentListStudent.attachment.action.download')"><a href="/community/proxy/equella/force-download/items/71c1f5d5-8a1f-4e85-84d6-7560a9e01b63/1/hanks.tomha.24066.PNG" class="ng-binding kb-mode"><i class="icon-download-alt"></i>Download</a></li>

Reality Student Central (5-15) 更新 titleInSequence

我做错了什么吗?我应该改变什么吗?任何帮助将不胜感激。

【问题讨论】:

    标签: angularjs onclick download href angularjs-routing


    【解决方案1】:

    那是因为您的路由器可能会将您重定向到主页。

    Angularjs simple file download

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-01-09
      • 2021-12-28
      • 2021-05-09
      • 2018-01-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-20
      相关资源
      最近更新 更多