我有一个嵌套的状态与目录内的文件路径相关联。也就是说,该视图的网址类似于/workspace/path/to/my/file.txt
。现在,仅仅使用/:path
不起作用。如何将ui-router配置为在路径中间接受斜杠?Angular UI-Router解析包含作为状态一部分的斜杠的URL
angular.module('myApp')
.config(function ($stateProvider) {
$stateProvider
.state('workspace.file', {
url: '/:path',
parent: 'workspace',
views: {
fileTabs: {
templateUrl: 'app/workspace/workspace.file/file.html',
}
},
controller: 'WorkspaceFileCtrl'
});
});