refactored window location with angular