-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
repro of bug related to property derived from args
Example of this code working correctly in the glimmer playground: http://bit.ly/2syFV7c
- Loading branch information
Showing
5 changed files
with
37 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
import Component from '@glimmer/component'; | ||
import Component, { tracked } from '@glimmer/component'; | ||
|
||
export default class BodegaGlimmerTest extends Component { | ||
@tracked myNumber = 1; | ||
|
||
make2() { | ||
this.myNumber = 2; | ||
} | ||
|
||
make3() { | ||
this.myNumber = 3; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
<div><h1>Welcome to Glimmer!</h1></div> | ||
<div> | ||
<button onclick={{action make2}}>number: 2</button> | ||
<button onclick={{action make3}}>number: 3</button> | ||
|
||
<my-second-component @number={{myNumber}}></my-second-component> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { setupRenderingTest } from '@glimmer/test-helpers'; | ||
import hbs from '@glimmer/inline-precompile'; | ||
|
||
const { module, test } = QUnit; | ||
|
||
module('Component: my-second-component', function(hooks) { | ||
setupRenderingTest(hooks); | ||
|
||
test('it renders', async function(assert) { | ||
await this.render(hbs`<my-second-component />`); | ||
assert.ok(this.containerElement.querySelector('div')); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import Component, { tracked } from '@glimmer/component'; | ||
|
||
export default class MySecondComponent extends Component { | ||
@tracked('args') | ||
get multiplied() { | ||
return this.args.number * 2; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<div>HELLO: multiply: {{multiplied}} (@number: {{@number}})</div> |