javascript - How to inherit a view in Ember.js -


i have view in ember.js looks like:

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");   } }); 

i need view same, except called forgotpassword, difference templatename.

is there way in ember.js, can forgotpassword inherits login, , set templatename forgotpassword?

thanks.

you can extend view created:

myapp.yourotherview = myapp.loginview.extend({    // whatever here applied `yourotherview` only..    templatename: 'other/template' }); 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -