Ember.js带有locationType的哈希符号的动态路由段:"哈希"

时间:2017-02-09 16:01:58

标签: javascript ember.js

我正在构建一个Ember应用程序,该应用程序将路径作为路径动态段参数传递到其他文档。该文档进一步显示在我的应用程序内的iframe中。我在环境和通配符路由中使用了locationType: hash选项,如下所示:https://stackoverflow.com/a/17053050/1367361

路线定义为:

this.route('display', {path: '*document_path'});

输入这样的URL后:

http://localhost/#/display/some/document.html

route:display使用参数:

调用model方法
{ document_path: "some/document.html" }

我希望能够在#中传递document_path,但输入的网址如下:

http://localhost/#/display/some/document.html#some-paragraph

#符号后删除所有内容并传递:

{ document_path: "some/document.html" }

进入model

我知道如果我将locationType更改为history,它就有效。但由于某些原因,我想使用hash locationType

使用#时,可以将locationType: hash作为动态细分传递?

0 个答案:

没有答案