是什么在ui.router和ui.state之间angularJS区别? [英] What is the difference in angularJS between ui.router and ui.state?

查看:144
本文介绍了是什么在ui.router和ui.state之间angularJS区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作得到一个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依赖必要的模块。请参阅<一个href=\"https://github.com/angular-ui/ui-router/blob/9ea2bb4c2b40009be76edd12c073c45db3db322e/README.md\">README在该版本中,以及从相关段<一href=\"https://github.com/angular-ui/ui-router/blob/9ea2bb4c2b40009be76edd12c073c45db3db322e/release/angular-ui-router.js\">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']);

的<一个href=\"https://github.com/angular-ui/ui-router/blob/818b0d69d2063064ca6d2e3b05252200439862d3/README.md\">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.

这当然是由<一个证实的href=\"https://github.com/angular-ui/ui-router/blob/master/release/angular-ui-router.js\">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']);

这篇关于是什么在ui.router和ui.state之间angularJS区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆