Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
257 views
in Technique[技术] by (71.8m points)

Angular ui-Router路径当做某个state的参数

首先这个效果我已经实现了,稍微有点瑕疵,强迫症受不了而已.
想做一个SPA应用用于显示一个路径里的目录结构,项目用了ui-router,创建了一个名字叫directory的state,URL匹配为/fs/{path:.*},于是乎/fs/dir1/dir2/dir3访问的时候$stateParampath能够获取到dir1/dir2/dir3,我把它用/切分放进面包屑导航作为路径导航,然而这时候出问题了,显示出来没毛病,当我用$state.go("directory",{path:"dir1/dir2"})的时候,地址栏中本来应该是/fs/dir1/dir2的,却发现/都被转义成了~2F,强迫症表示受不了啊,想知道有没有什么办法让他地址栏的内容中正斜杠不被转义,哪怕直接用url去导航也行....


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...