我的工作得到一个angularJS SPA安装使用角度UI路由器的多个视图。
I am working on getting an angularJS SPA setup with multiple views using angular ui-router.
我看着也不要蜘蛛D出现在网页教程和如何做的,我看到的依赖鱼龙混杂。 ui的路由器github上页都有使用 ui.router
作为模块依赖的例子,而其他物品,如本施瓦茨的教程使用 ui.state
。
As I look aroun dthe web at tutorials and how-to's, I see a mixed bag of dependencies. The ui-router github page has examples that use ui.router
as the module dependency, while other articles such as Ben Schwartz tutorial uses ui.state
.
有什么区别?一个德precated?为 ui.state
ui.router
?
What is the difference? Is one deprecated? Is ui.state
a subset of ui.router
?
推荐答案
在总结,是v0.0.1 ui.state
,而 UI .router
是v0.2.0(当前版本)。
In summary, ui.state
was for v0.0.1, while ui.router
is for v0.2.0 (the current version).
ui.state
是用户注入在UI的路由器v0.0.1依赖必要的模块。请参阅README在该版本中,以及从相关段angular-ui-router.js (45-48行):
ui.state
was the necessary module for users to inject as a dependency in v0.0.1 of ui-router. See the README at that release, as well as the relevant snippet from angular-ui-router.js (lines 45-48):
angular.module('ui.util', ['ng']);
angular.module('ui.router', ['ui.util']);
angular.module('ui.state', ['ui.router', 'ui.util']);
angular.module('ui.compat', ['ui.state']);
的README在根据快速启动v0.2.0状态:设置ui.router作为你的模块中的依赖。注意:使用ui.state如果使用v0.0.1
The README at v0.2.0 states under Quick Start: Set ui.router as a dependency in your module. Note: Use ui.state if using v0.0.1.
这当然是由angular-ui-router.js在v0.2.0,线79-83,示出了在该点相应的模块依赖关系的结构:
This is of course corroborated by angular-ui-router.js at v0.2.0, lines 79-83, showing the corresponding module dependency structure at that point:
angular.module('ui.router.util', ['ng']);
angular.module('ui.router.router', ['ui.router.util']);
angular.module('ui.router.state', ['ui.router.router', 'ui.router.util']);
angular.module('ui.router', ['ui.router.state']);
angular.module('ui.router.compat', ['ui.router']);
相关推荐
最新文章