new checkLogin()
Determines which page the user is allowed to see based on their login status (logged in or not). Sets an inital variable on the global 'window' object. This way the app knows if user is logged in or not, and based on that routes them to the appropriate web page. $location.path sets the url to the desired web page - built in angular method to route the client to a web page. See Angular docs for more information about $location: https://docs.angularjs.org/api/ng/service/$location
- Source: