Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请教一下三个注册组件的区别 #59

Closed
flyingshare opened this issue Dec 15, 2017 · 1 comment
Closed

请教一下三个注册组件的区别 #59

flyingshare opened this issue Dec 15, 2017 · 1 comment

Comments

@flyingshare
Copy link

Router.registerComponent();
router.addService();
uiRouter.registerUI();

这三种分别是什么作用

另外项目中
ReadBookService service = (ReadBookService)router.getService(ReadBookService.class.getSimpleName());
service始终是null,会是什么原因呢?

@mqzhangw
Copy link
Collaborator

你如果仔细看一下对应的两篇文章就能理解了。
第一个是注册组件,需要传入组件的ApplicationLike的全限定名
第二个是注册组件提供的服务,用于组件间数据交互
第三个是注册UI跳转服务
如果你拿到的service一直是null,肯定是第一步和第二步除了问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants