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

docs(controller): import base controller directly #1771

Merged
merged 1 commit into from
Dec 1, 2017

Conversation

dead-horse
Copy link
Member

@dead-horse dead-horse commented Dec 1, 2017

Checklist
  • npm test passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)
Description of change

@atian25
Copy link
Member

atian25 commented Dec 1, 2017

这样啊,如果很多级的 Controller,就要写很长的相对路径,感觉挺不 egg-style 的

@wuomzfx
Copy link

wuomzfx commented Dec 1, 2017

@atian25 虽然填写路径麻烦些,但是这样更灵活,不同的controller可以选择继承不同的基类,声明controller时,也更加清晰到底继承了哪些类。

@codecov-io
Copy link

Codecov Report

Merging #1771 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1771   +/-   ##
=======================================
  Coverage   99.58%   99.58%           
=======================================
  Files          29       29           
  Lines         729      729           
=======================================
  Hits          726      726           
  Misses          3        3
Impacted Files Coverage Δ
index.js
...ps/master-worker-started/node_modules/egg/index.js 100% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7ebfc9b...6c0444f. Read the comment docs.

```

Now we can use base class' methods when defining Controllers for the application:
Now we can use base class' methods by extends from `BaseController`:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

class' 语法错误

其他 +1 可以合并

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个就是这样的吧。其他地方语法错误更多,留待有缘人来改善吧。英语太差。

@dead-horse dead-horse merged commit a2788a8 into master Dec 1, 2017
@dead-horse dead-horse deleted the docs-controller-customize branch December 1, 2017 05:18
popomore pushed a commit that referenced this pull request Dec 1, 2017
docs(controller): import base controller directly (#1771)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

在app.js中自定义Controller基类的私有方法后,controller中无法使用
4 participants