我有以
形式定义的状态 $stateProvider
.state('school', _.extend({}, rootStateConfig, { url: '/school/:name}))
问题是每当我点击localhost/school/
它就会进入上面定义的状态。我该如何禁止空名?
答案 0 :(得分:1)
尝试先映射该状态。例如:
$stateProvider
.state('schoolNew', _.extend({}, rootStateConfig, { url: '/school'}))
.state('school', _.extend({}, rootStateConfig, { url: '/school/:name'}))