This repository has been archived by the owner on Mar 5, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
tracked property using "args" not updating #46
Comments
@habdelra I believe |
That's actually already in the Component base class: https://github.com/glimmerjs/glimmer-component/blob/master/src/component.ts#L165 |
@habdelra Remember that these are different: // "The `args` property changes"
@tracked args; and // "The `someOtherThing` property changes, and may change when `args` changes"
@tracked('args')
get someOtherThing() {
let { whatevs } = this.args;
} |
@habdelra this change seems to work in your repo: import Component, { tracked } from "@glimmer/component";
export default class ChildComponent extends Component {
- @tracked ("args.model.foo")
+ @tracked("args")
get foo() {
return this.args["model"].foo;
}
}
This makes |
Thanks Dan! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I've run into a scenario where a property that tracks a field off of
this.args
is not updating. I've setup a GH project to demonstrate this here: https://github.com/habdelra/glimmer-tracking-args.To summarize I have a parent component that contains a child component, with a data binding as expressed in the template.
The parent component looks like this:
the parent component template:
The child component has a tracked property that has a dependency on the passed in
@model
, but it never seems to update:The child component template:
when you run this app, you see this:
![screen shot 2017-04-11 at 5 23 01 pm](https://cloud.githubusercontent.com/assets/61075/24931512/8f8c21bc-1edb-11e7-9088-e993c7627981.png)
The text was updated successfully, but these errors were encountered: