【发布时间】:2016-07-29 21:22:25
【问题描述】:
我需要将上下文从操作挂钩(持久)传递到另一个(保存后),我知道 ctx.hookState 的 existence 但它不起作用。
ZZ.observe('persist', (ctx, next) => {
ctx.hookState = "pass this";
next();
}).catch(err => next(err));
});
ZZ.observe('after save', (ctx, next) => {
console.log(ctx.hookState);
next()
});
我在console.log(ctx.hookState) 中没有得到任何信息。我做错了什么?
谢谢。
【问题讨论】:
标签: loopbackjs loopback