ember.js - Find all components by name using wildcard -
is possible find ember components based on name using wildcard or regex?
so far found way find component fullname: appinstance.lookup('component:my-component')
but want achieve like: appinstance.lookup('component:my-*')
return array of components name begins 'my-'
you can list names of entries using require.entries
:
function getkeys(){ return object.keys(require.entries).filter(function(key){ return /.*components\/my-.*/.test(key); };
then can make lookup
keys. (be aware function getkeys
returns both component's js file names , template file names.)
Comments
Post a Comment