Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX release] Add mut to attributes in contextual components #13177

Merged
merged 1 commit into from
Mar 26, 2016

Conversation

Serabe
Copy link
Member

@Serabe Serabe commented Mar 24, 2016

As explained in issue #13061, given a component change-button with template:

<button {{action (action (mut val) 10)}}>Change to 10</button>

If it is invoked as in the following template:

{{change-button val=value}}
<span class="value">
  {{value}}
</span>

Clicking on the button will cause .value to contain 10.

On the other hand, invoking it via a closure component:

{{component (component "change-button" val=value)}}
<span class="value">
  {{value}}
</span>

Clicking on the button will not change the text in .value.

This PR adds a transform that adds mut to params and hash values.

@rwjblue
Copy link
Member

rwjblue commented Mar 26, 2016

I restarted the sauce labs tests, but can you also update the prefix to [BUGFIX release] (I think we will want this to land into the LTS)?

As explained in issue emberjs#13061, given a component `change-button` with template:

```hbs
<button {{action (action (mut val) 10)}}>Change to 10</button>
```

If it is invoked as in the following template:

```hbs
{{change-button val=value}}
<span class="value">
  {{value}}
</span>
```

Clicking on the button will cause `.value` to contain `10`.

On the other hand, invoking it via a closure component:

```hbs
{{component (component "change-button" val=value)}}
<span class="value">
  {{value}}
</span>
```

Clicking on the button will not change the text in `.value`.

This PR adds a transform that adds `mut` to params and hash values.
@Serabe Serabe changed the title [BUGFIX beta] Add mut to attributes in contextual components [BUGFIX release] Add mut to attributes in contextual components Mar 26, 2016
@Serabe
Copy link
Member Author

Serabe commented Mar 26, 2016

Done!

@rwjblue
Copy link
Member

rwjblue commented Mar 26, 2016

OK, this looks good to me. I'm going to land into canary and beta for some testing, but will backport into the LTS before shipping (assuming all is good).

@rwjblue rwjblue merged commit b79856c into emberjs:master Mar 26, 2016
@rwjblue
Copy link
Member

rwjblue commented Mar 26, 2016

Thank you @Serabe!

@Serabe
Copy link
Member Author

Serabe commented Mar 26, 2016 via email

@rwjblue
Copy link
Member

rwjblue commented Apr 3, 2016

Included in v2.4.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants