1
我想使用Mixin拦截动作列表(在控制器,路由或组件上执行特定动作函数之前)。有什么办法可以做到这一点?Ember.js中的动作钩子
的代码看起来是这样的:
App.MyMixin = Em.Mixin.create({
interceptorFunction : function(actionName){
console.log('intercepted action: ' + actionName);
}
});
App.TheInterceptedComponent = Em.Component.extend(App.MyMixin, {
actions : {
sampleAction : function() {
console.log('sampleAction std handler called');
}
}
});
寻找办法有intereptorFunction sampleAction之前调用。
谢谢。
很好,工作得很好。没有考虑重新排列论据。谢谢 –