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

Return the instance of breeze from the Configure Method #38

Open
Vaccano opened this issue Aug 9, 2016 · 2 comments
Open

Return the instance of breeze from the Configure Method #38

Vaccano opened this issue Aug 9, 2016 · 2 comments

Comments

@Vaccano
Copy link

Vaccano commented Aug 9, 2016

This file https://github.com/jdanyow/aurelia-breeze/blob/master/dist/aurelia-breeze.js, has a method called configure.

The only way I have found to get webpack and aurelia-breeze to work together involves modifying this file to return the instance of breeze that is configured in there. I then can use that instance in my application.

Would you be willing to make this modification. It can be done by adding:

 return breeze;

as the last line before the method closes? (Right after adapter.setHttpClientFactory(() => frameworkConfig.container.get(HttpClient));.)

@Vaccano
Copy link
Author

Vaccano commented Aug 9, 2016

Incase you are wondering, this is what I do in my app

import {configure as configureAureliaBreeze} from 'aurelia-breeze';
import {Container} from 'aurelia-dependency-injection';         
var breeze: any;

export class MyClassThatUsesBreeze {

      private entityManager: breeze.EntityManager;
      private metadataStore: breeze.MetadataStore;

      initialize() {
            breeze = configureAureliaBreeze({ container: Container.instance, globalResources: () => { } });
            // other stuff to setup the MetadataStore and EntityManager (and initialize my class).
      }
}

@Vaccano
Copy link
Author

Vaccano commented Aug 22, 2016

I found a way around this!

I add this to my main.ts and it adds a global instance of breeze that makes this change unnecessary:

require('expose?breeze!breeze-client/breeze.debug');

(This is only needed for Webpack.) Here is the answer on stackoverflow that showed me this.

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

No branches or pull requests

1 participant