What I want to do is to pass a string to helper, but I want more control over what string it gets passed in at runtime.
e.g.
// getComponentToRender will get the current UI theme in the app,
// determine whether it's running on a mobile mode, then fetches the
// appropriate name of a component to render based on the type of the
// component. Just an example.
I investigated this, it turns out this isn't possible (Otherwise, please correct me). Of course, there's computed property, but it doesn't take an argument.
Next, I looked into extending the helper. This stackoverflow question shows you can extend one, but I couldn't locate where the component helper is located in Ember. There doesn't seem to be any questions/documentation regarding extending existing helpers, either. What did I miss? It'd be great if someone can put me into the right direction.
Aucun commentaire:
Enregistrer un commentaire