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 beta] Ensure compat helpers calling options.fn work. #10279

Merged
merged 1 commit into from
Jan 25, 2015

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Jan 24, 2015

* Return value of helper function is not used when using a block.
* Calling `options.fn()` in a compat helper automatically appends
  content.
@rwjblue rwjblue force-pushed the ensure-compat-helper-functions-work branch from 381a3f6 to 4a41fa5 Compare January 24, 2015 23:13
@rwjblue
Copy link
Member Author

rwjblue commented Jan 24, 2015

Updated per discussion with @mmun.

rwjblue added a commit that referenced this pull request Jan 25, 2015
…-work

[BUGFIX beta] Ensure compat helpers calling options.fn work.
@rwjblue rwjblue merged commit 2477a7b into emberjs:master Jan 25, 2015
@rwjblue rwjblue deleted the ensure-compat-helper-functions-work branch January 25, 2015 16:45
@thejchap
Copy link
Contributor

@rwjblue Should options.inverse() be included in this as well?

@ritesh83
Copy link

ritesh83 commented Mar 9, 2015

We have a custom handlerbars helper.
It works fine with ember 1.8 but not with 1.10

In the initializer, we have:

    app.inject('helper', 'aclService', 'service:acl');

and in our helper:

    export default function(value, options) {
        var userAcl = this.get('aclService');   

        if(userAcl.get('isAdmin')) {
            return value.fn(this);
        } else {
            return value.inverse(this);  
        }
    }

The 'aclService' is now undefined in ember 1.10 (injections not working on helpers) and also the options.inverse was a function before but now it is an object (not callable).

Any suggestions on how to make it work in ember 1.10?

@pixelhandler
Copy link
Contributor

@rwjblue this seems related #10812 correct?

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.

Helper syntax documentation/clarification
4 participants