EmberJS:使用 link 从服务器的新 window 选项卡中获取 PDF

EmberJS: Get PDF in a new window tab from server using link

我想使用浏览器的默认行为使用 Ember 在新选项卡中打开 pdf 文件。
我没有使用 Ember-Data,我使用 Python 作为服务器端资源。所以我在 Ember 启动时将代理地址设置为指向服务器端地址。

我建立了一个路由页面,我有一个 link 可以在浏览器中打开我的 PDF 文件,比如

<a href="/path/apps/list.pdf?list=current" target="_blank">Open</a>

和服务器Python资源returns一个pdf:

@get("/list.pdf") 
@params(C.String("list"))
def get_list_pdf(list):   
    //some code to build the pdf string 
    Response(pdf_string, headers={'Content-Type': 'application/pdf'})

我在没有 ember 的应用程序中尝试从 link 访问资源,没问题。但是 Ember 我做不到。

我收到这个错误:未捕获的无法识别的 URLError:/path/apps/list.pdf?list=current ember.debug.js:4914

有什么建议可以实现吗?

作为我的问题的解决方案,我创建了一条新路线,并在其模板中添加了 html 对象元素。我还添加了一个 {{link-to 'the route' (query-params url='the url') }} 以转换到渲染 PDF 的路径。

template.hbs

<object data={{url}} type='application/pdf' />