今天我尝试更新我的应用程序以支持1.7.0,但我注意到视图中的操作处理程序停止了被调用。视图中的Ember操作在版本1.7.0中停止工作
我的观点定义如下:
// Ember view for the project partial
App.ProjectThumbnailView = Ember.View.extend({
templateName: 'partials/_project',
didInsertElement: function() {...},
/**
* Handles the event when the 'feature project' button is pressed
* @param {Project} project The project to be featured
*/
featureProject: function() {
var project = this.get('context');
project.toggleProperty('featured');
project.toggleProperty('abilities.feature');
project.toggleProperty('abilities.unfeature');
project.feature()
.then(
function() {},
function(error) {
project.toggleProperty('featured');
project.toggleProperty('abilities.feature');
project.toggleProperty('abilities.unfeature');
App.set('error', {
message: I18n.t('error_message_generic_server')
});
}
);
}
});
模板的谐音/ _project.hbs包含以下按钮来调用动作:
<button class="btn btn-mini btn-primary right-top" {{action 'featureProject' target='view'}}><i class="icon-star"></i> {{unbound i18n 'feature'}}</button>
我也试图把里面的的featureProject行动行动哈希无济于事。
这用于在1.6.0版本和之前的1.6版本中完美工作。有什么我失踪了吗?
谢谢。
你可以把一个bin显示出来吗?我做了一个箱子,它似乎工作正常。请参阅http://emberjs.jsbin.com/meqef/1/edit – tikotzky 2014-08-28 13:00:58
问题是,我的项目真的很大,我似乎无法用一小部分代码来重现错误,因为环境不同(模块等等,...)。 – rtemperv 2014-08-29 07:18:09
嗯....这将是棘手追查。 – tikotzky 2014-08-29 22:03:03