jeudi 11 juin 2015

In Ember how can I create a component by name programmatically

I can find lots of examples on how to create a component in Ember programmatically and add it to the DOM like this:

var comp = App.FooBarComponent.create();
comp.appendTo('#someArea');

But what would you do if you wanted to do it by a name provided?

var componentName = 'FooBar';
var comp = ???
comp.appendTo('#someArea');




Aucun commentaire:

Enregistrer un commentaire