Skip to content

Commit

Permalink
docs: add missing class in objects.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiye authored and dead-horse committed Jun 27, 2017
1 parent daa8227 commit 4322212
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/source/zh-cn/basics/objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,13 @@ module.exports = app => {
// 从 egg 上获取
const egg = require('egg');
module.exports = UserController extends egg.Controller {
module.exports = class UserController extends egg.Controller {
// implement
};
// 从 app 实例上获取
module.exports = app => {
return UserController extends app.Controller {
return class UserController extends app.Controller {
// implement
};
};
Expand All @@ -172,13 +172,13 @@ Service 基类的属性和 [Controller](#controller) 基类属性一致,访问
// app/service/user.js
// 从 egg 上获取
module.exports = UserService extends require('egg').Service {
module.exports = class UserService extends require('egg').Service {
// implement
};
// 从 app 实例上获取
module.exports = app => {
return UserService extends app.Service {
return class UserService extends app.Service {
// implement
};
};
Expand Down

0 comments on commit 4322212

Please sign in to comment.