@ducna01120/fleetops-engine
Version:
Fleet & Transport Management Extension for Fleetbase
9 lines (7 loc) • 397 B
JavaScript
import { dasherize } from '@ember/string';
export default function registerComponent(owner, componentClass, options = {}) {
const registrationName = options && options.as ? `component:${options.as}` : `component:${dasherize(componentClass.name).replace('-component', '')}`;
if (!owner.hasRegistration(registrationName)) {
owner.register(registrationName, componentClass);
}
}