ember-is-component
Version:
Provides a helper to check if a component exists.
11 lines (8 loc) • 514 B
JavaScript
import { assert } from '@ember/debug';
function isComponent(owner, componentName) {
assert('You must pass a owner to isComponent (isComponent checks if the owner you pass has a factory for the given component)', owner);
assert('You must pass a component name to isComponent (isComponent checks if the passed owner has a factory for the given component)', componentName);
return Boolean(owner.factoryFor(`component:${componentName}`));
}
export { isComponent as default };
//# sourceMappingURL=index.js.map