Thanks to visit codestin.com
Credit goes to github.com

Skip to content

$rootScope updating only with a one-cycle lag #8

Closed
@ricardo37

Description

@ricardo37

I noticed this problem both in my own installation and in the online demo. Figured out that it occurs because the $rootScope in which the GoogleTokenVerifier function is wrapped (in googleOAuth.js) is not the same $rootScope as that of the window from which the popup is called. I verified this by setting a variable on $rootScope in the calling window and noticing that this variable was undefined inside GoogleTokenVerifier().

Everything works fine once I strip the GoogleTokenVerifier function of its $injector.invoke wrapping and move it inside the $get function in angularOAuth.js. Not sure how to achieve this same result while retaining a separate googleOauth module. Brighter minds, I'm sure, can work that one out...

The problem I've identified, by the way, is a side-effect of the one causing Issue #1. VerifyAsync is called but its deferred.resolve function is not called (until the next cycle) because the $apply() function in which the GoogleTokenVerifier function is wrapped is pointing to the wrong $rootScope.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions