路由器绑定实际用于什么 [英] What are Router Bindings actually used for

查看:80
本文介绍了路由器绑定实际用于什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是Angular2路由器中实际使用的路由器绑定.特别是路由器3.0(最新的Angular RC4路由器)?任何有效的代码或插件吗?

What are Router Bindings actually used for in Angular2 router. specially the Router 3.0 (newest Angular RC4 router)? Any working code or plunker?

https://angular.io/docs/ts/latest/api/router-deprecated/index/ROUTER_BINDINGS-let.html

推荐答案

名称刚刚从ROUTER_BINDINGS更改为ROUTER_PROVIDERS,而@Component()@Directive()@Pipe()bindings参数也是如此装饰器已重命名为providers,它们实际上是路由器实现和由路由器实现提供的服务,将被注入您的代码中.

The name was just changed from ROUTER_BINDINGS to ROUTER_PROVIDERS as were the bindings parameter of the @Component(), @Directive() or @Pipe() decorator was renamed to providers and they actually are the router implementation and services provided by the router implementation to be used injected in your code.

在当前版本中,此功能导出为功能 provideRouter()

In the current version this feature is exported as function provideRouter()

似乎ROUTER_PROVIERS将再次重命名为RouterModule,或者与RC.5中引入的模块类似.

It looks like ROUTER_PROVIERS is going to be renamed again to RouterModule or similar with the introduction of modules in RC.5.

这篇关于路由器绑定实际用于什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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