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

Example is not working in latest release #13

Closed
pasviegas opened this issue Oct 5, 2017 · 5 comments
Closed

Example is not working in latest release #13

pasviegas opened this issue Oct 5, 2017 · 5 comments
Assignees
Labels

Comments

@pasviegas
Copy link
Contributor

I don't know if you guys noticed but the example doesn't seem to be working anymore after last release.

It seems like the mediator is not initialized.

I am probably doing this wrong, but if I change

// ContainerRegistry.ts
public findParentBinding(target: any): ContainerBinding {
        let parent: any = target.parent;
        while (parent) {
            const binding: ContainerBinding = this._bindingByContainer.get(
                parent
            );
            if (binding) {
                return binding;
            }
            parent = parent.parent;
        }
        return null;
    }

to

// ContainerRegistry.ts
public findParentBinding(target: any): ContainerBinding {
        let parent: any = target.parent;
        while (parent) {
            const binding: ContainerBinding = this._bindingByContainer.get(
                parent
            );
            if (binding) {
                return binding;
            }
            parent = parent.parent;
        }
        return this.rootBindings[0];
    }

It works.

Best

@tiagoschenkel
Copy link
Member

The usage of the const declaration inside the while loop appears to be wrong, since it should be a let declaration.

Let me write some unit tests for the version before we applied the changes and see if I can catch what is not working anymore.

@pasviegas
Copy link
Contributor Author

Nice! Thanks! :D

@tiagoschenkel
Copy link
Member

The pull request #17 solves this issue. A new version will be released soon.

@tiagoschenkel
Copy link
Member

Problem not solved yet, still investigating, :(

@tiagoschenkel
Copy link
Member

Release 0.0.6 solves this issue.

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

2 participants