Ember.js 如何同步调用余烬操作
我想同步执行两个余烬操作,正确的方法是什么。比如说Ember.js 如何同步调用余烬操作,ember.js,Ember.js,我想同步执行两个余烬操作,正确的方法是什么。比如说 this.send('closeModal'); this.send('openModal','login'); // run when `closeModal` is totally executed 或者如何在路由中调用操作而不使用send export default Ember.Route.extend({ actions:{ openModal: function () { //how to execute like
this.send('closeModal');
this.send('openModal','login'); // run when `closeModal` is totally executed
或者如何在路由中调用操作而不使用send
export default Ember.Route.extend({
actions:{
openModal: function () {
//how to execute like this.closeModal(); without .send
... logic...
});
closeModal: function () {
... logic...
});
}
});
也许您可以将操作逻辑移动到路由上的其他功能,即
export default Ember.Route.extend({
openModal: function() {
...logic...
},
closeModal: function() {
...logic...
},
actions:{
openModal: function () {
this.closeModal(); // Ensure other modals are closed.
this.openModal();
});
closeModal: function () {
this.closeModal();
});
}
});