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

HttpClientService无法引入使用 #24

Closed
zzzhan opened this issue Mar 15, 2018 · 4 comments
Closed

HttpClientService无法引入使用 #24

zzzhan opened this issue Mar 15, 2018 · 4 comments

Comments

@zzzhan
Copy link

zzzhan commented Mar 15, 2018

LoginComponentHttpService替换为HttpClientService时没有报错,但登录页出不来。去掉constructorHttpClientService的引用就可以。不知哪出了问题? @myopenresources

@myopenresources
Copy link
Owner

myopenresources commented Mar 15, 2018

@zzzhan http与http-client机制不一样,你得把原来所有用到HttpService请求的地方全部修改成HttpClientService

@zzzhan
Copy link
Author

zzzhan commented Mar 15, 2018

http-client使用有什么前提吗?跟http的使用有什么不同?我不是升级哦,第一次clone了你的项目,在LoginComponent里只是简单地试一下用http-client.结果页面刷新后是空白的,也没报什么错。 @myopenresources

@zzzhan
Copy link
Author

zzzhan commented Mar 15, 2018

找到问题了,需要在app.module.ts里把HttpModule替换为HttpClientModule,HttpService替换为HttpClientService. Work like a charm:)

@myopenresources
Copy link
Owner

@zzzhan 恩,是的

@zzzhan zzzhan closed this as completed Dec 4, 2019
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