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] Expose ownerInjection method on ContainerProxy. #12629

Merged
merged 1 commit into from
Nov 20, 2015

Commits on Nov 20, 2015

  1. [BUGFIX beta] Expose ownerInjection method on ContainerProxy.

    The `ember-container-inject-owner` feature provides a public API for
    accessing various container/registry functions. Unfortunately, creating
    an instance that has access to the same owner is a somewhat annoying
    API compared to what we would do today.
    
    In Ember 2.2 you would often do this (though it still uses private API):
    
    ```js
    User.create({
     container: this.container,
     username: 'John'
    });
    ```
    
    But in 2.3.0-beta.1 to do roughly the same thing, you would have to do:
    
    ```js
    var options = { username: 'John' };
    setOwner(options, getOwner(this));
    
    User.create(options);
    ```
    
    This is definitely less ergonomic for a perfectly supported case.  With
    the changes added here, you would use the following:
    
    ```js
    User.create(
     getOwner(this).ownerInjection(),
     { username: 'John' }
    );
    ```
    rwjblue committed Nov 20, 2015
    Configuration menu
    Copy the full SHA
    6d063b8 View commit details
    Browse the repository at this point in the history