You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Ember 1.13.7, with addon generated by ember 1.13.8, I have a component x-foo:
import Ember from 'ember';
import layout from './template';
export default Ember.Component.extend({
layout: layout,
didReceiveAttrs() {
console.log("didReceiveAttrs; foo:", this.getAttr('foo'));
},
willRender() {
console.log("willRender; foo:", this.getAttr('foo'));
}
});
When I instantiate in a test using angle-bracket notation (with feature flags turned on), I can't set attributes. Using the following test, "didReceiveAttrs" and "willRender" are never called.
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('x-foo', 'Integration | Component | x foo', {
integration: true
});
test('it renders', function(assert) {
assert.expect(0);
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });
this.set('foo', 'bar');
this.render(hbs`<x-foo foo={{mut foo}} />`);```
this.set('foo', 'baz');
}
They are called when I run with the following render instead.
this.render(hbs`{{x-foo foo=(mut foo)}}`);
In this case the output in the console is:
didReceiveAttrs; foo: bar
willRender; foo: bar
didReceiveAttrs; foo: baz
willRender; foo: baz```
The text was updated successfully, but these errors were encountered:
I'm a little bit lost in the source code. I checked out the "glimmer-component" branch, and was looking through it to try to find where I should add a test. There I found tests such as "glimmer components cannot be invoked with curly braces" and "legacy components cannot be invoked with angle brackets".
To hit the bug, I used "ember g component x-foo --pod" to generate the component, which gives it a default template of "{{yield}}" which I didn't change. Does this make it a legacy component? Or a glimmer component? (How is one or the other triggered in user code?)
Also, where do you want me to put the test -- into: "packages/ember-htmlbars/tests/integration/component_invocation_test.js" ?
I am closing this issue since the story around angle bracket components is being revisited.
Feel free to re-open the issue if you think it's still justified, thank you.
Using Ember 1.13.7, with addon generated by ember 1.13.8, I have a component
x-foo
:When I instantiate in a test using angle-bracket notation (with feature flags turned on), I can't set attributes. Using the following test, "didReceiveAttrs" and "willRender" are never called.
They are called when I run with the following render instead.
In this case the output in the console is:
The text was updated successfully, but these errors were encountered: