Refactor globals/"namespaces" in JS to Angular entities
For reasons why global variables are bad, people commonly reference the "GlobalVariablesAreBad" article. Additionally, Angular already provides solutions to homebrew namespaces, so they don't have to be used.
I was going to add example files, but it's so widespread, just look in any of the JS for the experiments/toolchains/etc. apps. A common manifestation of the globals:
// Declaration of our namespaces
if (beat === undefined)
var beat = {}
if (beat.toolchains === undefined)
beat.toolchains = {}
if (beat.toolchains.dialogs === undefined)
beat.toolchains.dialogs = {}
And later in the file, fields are assigned to these globals.
A better approach may be to instead use Angular Services which support DI (dependency injection) and are designed to support heavy processing/data functionality.