All can-import tests are passing again #2045

Merged
merged 3 commits into from Nov 9, 2015

Conversation

Projects
None yet
3 participants
@matthewp
Contributor

matthewp commented Oct 30, 2015

This updates all of the can-import tests to use the new binding syntax.
One of the tests uses this method:

<can-import from='can/view/import/test/other.stache!' {^@value}='*other'
/>

{{{*other()}}}

While all of the others use the old syntax:

<can-import from='can/view/import/test/other.stache!' {^@value}='*other'
/>

{{> *other}}

So we know that both do work.

One change I had to make was to prevent can.Component from setting up
it's own bindings when can-import is used with can-tag. This is
because the bindings are performed in can/view/bindings instead.

Closes #2042 and #2044

@matthewp

This comment has been minimized.

Show comment
Hide comment
@matthewp

matthewp Oct 30, 2015

Contributor

@justinbmeyer I'd like you to review this PR, particularly the changes I made to component/component.js where I pass in a preventDataBindings flag into the tagData to fix the can-import can-tag problem. Maybe there's a more elegant way.

Contributor

matthewp commented Oct 30, 2015

@justinbmeyer I'd like you to review this PR, particularly the changes I made to component/component.js where I pass in a preventDataBindings flag into the tagData to fix the can-import can-tag problem. Maybe there's a more elegant way.

@daffl daffl added this to the 2.3.2 milestone Nov 4, 2015

matthewp added a commit that referenced this pull request Nov 9, 2015

Use preventDataBindings in can/component
This uses the element's data `preventDataBindings` to control whether we
set up bindings in can/component. This is needed because in the case of
can-import's `can-tag` functionality we do not want bindings to be set
up. In can/view/import now we toggle preventDataBindings to true so that
can/component will not set them up and then afterwards toggle it back to
false so that can/view/bindings will. Closes #2045

matthewp added some commits Oct 29, 2015

All can-import tests are passing again
This updates all of the can-import tests to use the new binding syntax.
One of the tests uses this method:

```handlebars
<can-import from='can/view/import/test/other.stache!' {^@value}='*other'
/>

{{{*other()}}}
```

While all of the others use the old syntax:

```handlebars
<can-import from='can/view/import/test/other.stache!' {^@value}='*other'
/>

{{> *other}}
```

So we know that both do work.

One change I had to make was to prevent can.Component from setting up
it's own bindings when can-import is used with `can-tag`. This is
because the bindings are performed in can/view/bindings instead.

Closes #2042 and #2044
Use preventDataBindings in can/component
This uses the element's data `preventDataBindings` to control whether we
set up bindings in can/component. This is needed because in the case of
can-import's `can-tag` functionality we do not want bindings to be set
up. In can/view/import now we toggle preventDataBindings to true so that
can/component will not set them up and then afterwards toggle it back to
false so that can/view/bindings will. Closes #2045

julia-allyce added a commit that referenced this pull request Nov 9, 2015

Merge pull request #2045 from canjs/import-test
All can-import tests are passing again

@julia-allyce julia-allyce merged commit 7c43429 into master Nov 9, 2015

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@julia-allyce julia-allyce deleted the import-test branch Nov 9, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment