Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

New URL in $rootScope.$watch in $LocationProvider #10515

Closed
@OpenSiteMobile

Description

@OpenSiteMobile

Looking at the latest version (AngularJS v1.3.7), I came across this in the $LocationProvider -> $rootScope.$watch function $locationWatch.

Under $rootScope.$watch, newUrl = trimEmptyHash($location.absUrl()), but under the $rootScope.$evalAsync function, newUrl (a new variable) = $location.absUrl().

Maybe this is the way it is suppose to be, but it does make one wonder if you are comparing apples to oranges later in the $rootScope.$evalAsync function. I'm still learning AngularJS and there is a lot going on here with the $rootScope.$broadcast stuff going on just before the newUrl variable is compared again, so unfortunately I can't help give a definitive answer. But it might be better to rename the inner function scope variable something slightly different, so it won't be confused for the outer scope one in the future. At least that would make it more evident that this is the correct structure.

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