import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { getOwner } from '@ember/application';
export default class Demo extends Component {
format = (data) => JSON.stringify(data, null, 2);
@tracked name = 'template-only';
get results() {
let owner = getOwner(this);
let name = this.name;
return {
[`component:${name}`]: owner.hasRegistration(`component:${name}`),
// added this for curiosity
[`template:${name}`]: owner.hasRegistration(`template:${name}`),
};
}
}
1条答案
按热度按时间dsekswqp1#
我在stackblitz上为你做了一个演示:
https://stackblitz.com/edit/github-k7htnb?file=app%2Fcomponents%2Fdemo.hbs升
下面的代码显示了您在Ember 3.28中所做的工作:
现在,如果我将ember源更改为3.26.1,它是相同的。
也许你正在做的和这个演示正在做的之间有一点代码不匹配?