我在 Ember.js 中有一个看起来像这样的视图:
MyApp.LoginView = Ember.View.extend({
templateName: 'login',
didInsertElement: function() {
$("body").addClass("light-bg");
$("footer").css("display", "none");
$("input[name=email]").focus();
},
willDestroyElement: function() {
$("body").removeClass("light-bg");
$("footer").css("display", "block");
}
});
我需要另一个完全相同的视图,除了它被称为ForgotPassword
,因此唯一的区别是templateName
.
Ember.js 中有没有办法,我可以说ForgotPassword
继承Login
,然后将 templateName 设置为forgotPassword
?
谢谢。