3

这是我所拥有的

<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>

现实学生中心(5-15)更新标题InSequence

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

4

1 回答 1

1

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

Angularjs 简单文件下载

于 2013-09-25T20:50:01.523 回答