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

Inverse ^if doesn't work correctly with an else #751

Closed
matthewp opened this issue Feb 20, 2014 · 3 comments
Closed

Inverse ^if doesn't work correctly with an else #751

matthewp opened this issue Feb 20, 2014 · 3 comments
Labels
Milestone

Comments

@matthewp
Copy link
Contributor

The inverse if is not documented so I'm not sure if this is really a bug but here is a fiddle.

Problems in the fiddle:

  • When falsey it shows the inverse section.
  • When truthy it shows nothing.

VOTE HERE: http://bithub.com/event/30947

@daffl daffl added this to the 2.0.6 milestone Feb 20, 2014
@justinbmeyer
Copy link
Contributor

Yeah, I noticed this when implementing stash.

Sent from my iPhone

On Feb 20, 2014, at 3:22 PM, Matthew Phillips notifications@github.com wrote:

The inverse if is not documented so I'm not sure if this is really a bug but here is a fiddle.

Problems in the fiddle:

When falsey it shows the inverse section.
When truthy it shows nothing.

Reply to this email directly or view it on GitHub.

@daffl daffl added the Bug label Feb 26, 2014
@matthewp
Copy link
Contributor Author

Problem is it generates 2 inverse functions. Not sure what the correct way to fix this is. Should this be "corrected" just before it's handed off to the helper?

            {inverse: function(scope, options) {
                    var ___v1ew = [];
                    ___v1ew.push(
                    "<div>Not showing</div>");
                    return ___v1ew.join("");
                }}, 
            {inverse: function(scope, options) {
                    var ___v1ew = [];
                    ___v1ew.push(
                    "<div>Is showing</div>");
                    return ___v1ew.join("");
                }}

matthewp added a commit to matthewp/canjs that referenced this issue Feb 28, 2014
@daffl daffl modified the milestones: 2.1.0, 2.0.6 Mar 13, 2014
alexisabril pushed a commit that referenced this issue Apr 2, 2014
@alexisabril
Copy link
Contributor

Note: Pull #759 from @matthewp into minor prior to #859 as one is the fix, one is the test.

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

No branches or pull requests

4 participants