javascript - Bind function on template creation in Ember.js -
i have handlebars template needs have javascript function run on creation. possible in ember/handlebars? specifically, partial creates "status bar" percentage , amount of bar filled up. have working function this, need way have run status bars (there many on page) when load.
i wrap progress bars in ember component. use didinsertelement
trigger function. additionally scope particular progress bar instance.
app.progressbarcomponent = em.component.extend({ somefunc: function(){ this.myfunc(); }.on('didinsertelement'), myfunc: function(){ console.log('this component is', this.$()); } });
Comments
Post a Comment