否则,在StateProvider [英] Otherwise on StateProvider
本文介绍了否则,在StateProvider的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
采用了棱角分明的UI路由器,我如何可以使用的否则方法 = https://github.com/angular-ui/ui-router/wiki\">$stateProvider 或我如何使用它呢?
Using angular-ui-router, How can I use the otherwise method on $stateProvider or how can I use it at all ?
推荐答案
您不能只使用stateProvider $。
You can't use only $stateProvider.
您需要注入$ urlRouterProvider并创建类似code:
You need to inject $urlRouterProvider and create a code similar to:
$urlRouterProvider.otherwise('/otherwise');
的 /否则
url必须对一个国家像往常一样来定义:
The /otherwise
url must be defined on a state as usual:
$stateProvider
.state("otherwise", { url : '/otherwise'...})
请参阅此链接, ksperling解释
这篇关于否则,在StateProvider的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文