我正在构建一个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
作为动态细分传递?