Skip to content

Commit

Permalink
feat(octane): remove deprecation by using component class instead of …
Browse files Browse the repository at this point in the history
…the name
  • Loading branch information
josex2r committed Dec 1, 2021
1 parent f6d262a commit c9be982
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion addon/models/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { isBlank } from '@ember/utils';
import PromiseProxyMixin from '@ember/object/promise-proxy-mixin';
import { tracked } from '@glimmer/tracking';
import { ensureSafeComponent } from '@embroider/util';
import { getOwner } from '@ember/application';

export default class ModalModel extends EmberObject.extend(PromiseProxyMixin) {
@tracked name;
Expand Down Expand Up @@ -33,7 +34,11 @@ export default class ModalModel extends EmberObject.extend(PromiseProxyMixin) {
}

get componentName() {
return ensureSafeComponent(this.fullname, this);
const componentFactory = getOwner(this).factoryFor(
`component:${this.fullname}`
);

return ensureSafeComponent(componentFactory.class, this);
}

resolve() {
Expand Down

0 comments on commit c9be982

Please sign in to comment.